diff options
Diffstat (limited to 'settings')
-rw-r--r-- | settings/Controller/MailSettingsController.php | 4 | ||||
-rw-r--r-- | settings/Hooks.php | 10 | ||||
-rw-r--r-- | settings/Mailer/NewUserMailHelper.php | 4 |
3 files changed, 4 insertions, 14 deletions
diff --git a/settings/Controller/MailSettingsController.php b/settings/Controller/MailSettingsController.php index cb622fa9b12..02bd51e843e 100644 --- a/settings/Controller/MailSettingsController.php +++ b/settings/Controller/MailSettingsController.php @@ -159,9 +159,7 @@ class MailSettingsController extends Controller { $message = $this->mailer->createMessage(); $message->setTo([$email => $displayName]); - $message->setSubject($template->renderSubject()); - $message->setHtmlBody($template->renderHtml()); - $message->setPlainBody($template->renderText()); + $message->useTemplate($template); $errors = $this->mailer->send($message); if (!empty($errors)) { throw new \RuntimeException($this->l10n->t('Email could not be sent. Check your mail server log')); diff --git a/settings/Hooks.php b/settings/Hooks.php index 3da85b4ae74..59bd7bb905d 100644 --- a/settings/Hooks.php +++ b/settings/Hooks.php @@ -132,10 +132,7 @@ class Hooks { $message = $this->mailer->createMessage(); $message->setTo([$user->getEMailAddress() => $user->getDisplayName()]); - $message->setSubject($template->renderSubject()); - $message->setBody($template->renderText(), 'text/plain'); - $message->setHtmlBody($template->renderHtml()); - + $message->useTemplate($template); $this->mailer->send($message); } } @@ -208,10 +205,7 @@ class Hooks { $message = $this->mailer->createMessage(); $message->setTo([$oldMailAddress => $user->getDisplayName()]); - $message->setSubject($template->renderSubject()); - $message->setBody($template->renderText(), 'text/plain'); - $message->setHtmlBody($template->renderHtml()); - + $message->useTemplate($template); $this->mailer->send($message); } } diff --git a/settings/Mailer/NewUserMailHelper.php b/settings/Mailer/NewUserMailHelper.php index af1627a08e3..935b3f0e075 100644 --- a/settings/Mailer/NewUserMailHelper.php +++ b/settings/Mailer/NewUserMailHelper.php @@ -160,10 +160,8 @@ class NewUserMailHelper { IEMailTemplate $emailTemplate) { $message = $this->mailer->createMessage(); $message->setTo([$user->getEMailAddress() => $user->getDisplayName()]); - $message->setSubject($emailTemplate->renderSubject()); - $message->setHtmlBody($emailTemplate->renderHtml()); - $message->setPlainBody($emailTemplate->renderText()); $message->setFrom([$this->fromAddress => $this->themingDefaults->getName()]); + $message->useTemplate($emailTemplate); $this->mailer->send($message); } } |