| @@ 443-467 (lines=25) @@ | ||
| 440 | * |
|
| 441 | * @throws Exception |
|
| 442 | */ |
|
| 443 | protected function sendMail($fileName, $link, $author, $circleName, $email) { |
|
| 444 | $message = $this->mailer->createMessage(); |
|
| 445 | ||
| 446 | $this->logger->log( |
|
| 447 | 0, "Sending mail to circle '" . $circleName . "': " . $email . ' file: ' . $fileName |
|
| 448 | . ' - link: ' . $link |
|
| 449 | ); |
|
| 450 | ||
| 451 | $subject = $this->l10n->t('%s shared »%s« with you.', [$author, $fileName]); |
|
| 452 | $text = $this->l10n->t('%s shared »%s« with \'%s\'.', [$author, $fileName, $circleName]); |
|
| 453 | ||
| 454 | $emailTemplate = |
|
| 455 | $this->generateEmailTemplate($subject, $text, $fileName, $link, $author, $circleName); |
|
| 456 | ||
| 457 | $instanceName = $this->defaults->getName(); |
|
| 458 | $senderName = $this->l10n->t('%s on %s', [$author, $instanceName]); |
|
| 459 | ||
| 460 | $message->setFrom([Util::getDefaultEmailAddress($instanceName) => $senderName]); |
|
| 461 | $message->setSubject($subject); |
|
| 462 | $message->setPlainBody($emailTemplate->renderText()); |
|
| 463 | $message->setHtmlBody($emailTemplate->renderHtml()); |
|
| 464 | $message->setTo([$email]); |
|
| 465 | ||
| 466 | $this->mailer->send($message); |
|
| 467 | } |
|
| 468 | ||
| 469 | ||
| 470 | /** |
|
| @@ 277-301 (lines=25) @@ | ||
| 274 | * |
|
| 275 | * @throws Exception |
|
| 276 | */ |
|
| 277 | protected function sendMail($fileName, $link, $author, $circleName, $email) { |
|
| 278 | $message = $this->mailer->createMessage(); |
|
| 279 | ||
| 280 | $this->miscService->log( |
|
| 281 | "Sending mail to circle '" . $circleName . "': " . $email . ' file: ' . $fileName |
|
| 282 | . ' - link: ' . $link, 0 |
|
| 283 | ); |
|
| 284 | ||
| 285 | $subject = $this->l10n->t('%s shared »%s« with you.', [$author, $fileName]); |
|
| 286 | $text = $this->l10n->t('%s shared »%s« with \'%s\'.', [$author, $fileName, $circleName]); |
|
| 287 | ||
| 288 | $emailTemplate = |
|
| 289 | $this->generateEmailTemplate($subject, $text, $fileName, $link, $author, $circleName); |
|
| 290 | ||
| 291 | $instanceName = $this->defaults->getName(); |
|
| 292 | $senderName = $this->l10n->t('%s on %s', [$author, $instanceName]); |
|
| 293 | ||
| 294 | $message->setFrom([Util::getDefaultEmailAddress($instanceName) => $senderName]); |
|
| 295 | $message->setSubject($subject); |
|
| 296 | $message->setPlainBody($emailTemplate->renderText()); |
|
| 297 | $message->setHtmlBody($emailTemplate->renderHtml()); |
|
| 298 | $message->setTo([$email]); |
|
| 299 | ||
| 300 | $this->mailer->send($message); |
|
| 301 | } |
|
| 302 | ||
| 303 | ||
| 304 | /** |
|