| @@ 445-469 (lines=25) @@ | ||
| 442 | * |
|
| 443 | * @throws Exception |
|
| 444 | */ |
|
| 445 | protected function sendMail($fileName, $link, $author, $circleName, $email) { |
|
| 446 | $message = $this->mailer->createMessage(); |
|
| 447 | ||
| 448 | $this->logger->log( |
|
| 449 | 0, "Sending mail to circle '" . $circleName . "': " . $email . ' file: ' . $fileName |
|
| 450 | . ' - link: ' . $link |
|
| 451 | ); |
|
| 452 | ||
| 453 | $subject = $this->l10n->t('%s shared »%s« with you.', [$author, $fileName]); |
|
| 454 | $text = $this->l10n->t('%s shared »%s« with \'%s\'.', [$author, $fileName, $circleName]); |
|
| 455 | ||
| 456 | $emailTemplate = |
|
| 457 | $this->generateEmailTemplate($subject, $text, $fileName, $link, $author, $circleName); |
|
| 458 | ||
| 459 | $instanceName = $this->defaults->getName(); |
|
| 460 | $senderName = $this->l10n->t('%s on %s', [$author, $instanceName]); |
|
| 461 | ||
| 462 | $message->setFrom([Util::getDefaultEmailAddress($instanceName) => $senderName]); |
|
| 463 | $message->setSubject($subject); |
|
| 464 | $message->setPlainBody($emailTemplate->renderText()); |
|
| 465 | $message->setHtmlBody($emailTemplate->renderHtml()); |
|
| 466 | $message->setTo([$email]); |
|
| 467 | ||
| 468 | $this->mailer->send($message); |
|
| 469 | } |
|
| 470 | ||
| 471 | ||
| 472 | /** |
|
| @@ 317-341 (lines=25) @@ | ||
| 314 | * |
|
| 315 | * @throws Exception |
|
| 316 | */ |
|
| 317 | protected function sendMail($fileName, $link, $author, $circleName, $email) { |
|
| 318 | $message = $this->mailer->createMessage(); |
|
| 319 | ||
| 320 | $this->miscService->log( |
|
| 321 | "Sending mail to circle '" . $circleName . "': " . $email . ' file: ' . $fileName |
|
| 322 | . ' - link: ' . $link, 0 |
|
| 323 | ); |
|
| 324 | ||
| 325 | $subject = $this->l10n->t('%s shared »%s« with you.', [$author, $fileName]); |
|
| 326 | $text = $this->l10n->t('%s shared »%s« with \'%s\'.', [$author, $fileName, $circleName]); |
|
| 327 | ||
| 328 | $emailTemplate = |
|
| 329 | $this->generateEmailTemplate($subject, $text, $fileName, $link, $author, $circleName); |
|
| 330 | ||
| 331 | $instanceName = $this->defaults->getName(); |
|
| 332 | $senderName = $this->l10n->t('%s on %s', [$author, $instanceName]); |
|
| 333 | ||
| 334 | $message->setFrom([Util::getDefaultEmailAddress($instanceName) => $senderName]); |
|
| 335 | $message->setSubject($subject); |
|
| 336 | $message->setPlainBody($emailTemplate->renderText()); |
|
| 337 | $message->setHtmlBody($emailTemplate->renderHtml()); |
|
| 338 | $message->setTo([$email]); |
|
| 339 | ||
| 340 | $this->mailer->send($message); |
|
| 341 | } |
|
| 342 | ||
| 343 | ||
| 344 | /** |
|