summaryrefslogtreecommitdiffstats
path: root/settings/Controller/MailSettingsController.php
diff options
context:
space:
mode:
Diffstat (limited to 'settings/Controller/MailSettingsController.php')
-rw-r--r--settings/Controller/MailSettingsController.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/settings/Controller/MailSettingsController.php b/settings/Controller/MailSettingsController.php
index 974a95618ad..02bd51e843e 100644
--- a/settings/Controller/MailSettingsController.php
+++ b/settings/Controller/MailSettingsController.php
@@ -151,6 +151,7 @@ class MailSettingsController extends Controller {
'displayname' => $displayName,
]);
+ $template->setSubject($this->l10n->t('Email setting test'));
$template->addHeader();
$template->addHeading($this->l10n->t('Well done, %s!', [$displayName]));
$template->addBodyText($this->l10n->t('If you received this email, the email configuration seems to be correct.'));
@@ -158,9 +159,7 @@ class MailSettingsController extends Controller {
$message = $this->mailer->createMessage();
$message->setTo([$email => $displayName]);
- $message->setSubject($this->l10n->t('Email setting test'));
- $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'));