summaryrefslogtreecommitdiffstats
path: root/settings/Hooks.php
diff options
context:
space:
mode:
Diffstat (limited to 'settings/Hooks.php')
-rw-r--r--settings/Hooks.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/settings/Hooks.php b/settings/Hooks.php
index 6f537796517..59bd7bb905d 100644
--- a/settings/Hooks.php
+++ b/settings/Hooks.php
@@ -122,6 +122,8 @@ class Hooks {
'emailAddress' => $user->getEMailAddress(),
'instanceUrl' => $instanceUrl,
]);
+
+ $template->setSubject($this->l->t('Password for %1$s changed on %2$s', [$user->getDisplayName(), $instanceUrl]));
$template->addHeader();
$template->addHeading($this->l->t('Password changed for %s', [$user->getDisplayName()]), false);
$template->addBodyText($text . ' ' . $this->l->t('If you did not request this, please contact an administrator.'));
@@ -130,10 +132,7 @@ class Hooks {
$message = $this->mailer->createMessage();
$message->setTo([$user->getEMailAddress() => $user->getDisplayName()]);
- $message->setSubject($this->l->t('Password for %1$s changed on %2$s', [$user->getDisplayName(), $instanceUrl]));
- $message->setBody($template->renderText(), 'text/plain');
- $message->setHtmlBody($template->renderHtml());
-
+ $message->useTemplate($template);
$this->mailer->send($message);
}
}
@@ -193,6 +192,8 @@ class Hooks {
'oldEMailAddress' => $oldMailAddress,
'instanceUrl' => $instanceUrl,
]);
+
+ $template->setSubject($this->l->t('Email address for %1$s changed on %2$s', [$user->getDisplayName(), $instanceUrl]));
$template->addHeader();
$template->addHeading($this->l->t('Email address changed for %s', [$user->getDisplayName()]), false);
$template->addBodyText($text . ' ' . $this->l->t('If you did not request this, please contact an administrator.'));
@@ -204,10 +205,7 @@ class Hooks {
$message = $this->mailer->createMessage();
$message->setTo([$oldMailAddress => $user->getDisplayName()]);
- $message->setSubject($this->l->t('Email address for %1$s changed on %2$s', [$user->getDisplayName(), $instanceUrl]));
- $message->setBody($template->renderText(), 'text/plain');
- $message->setHtmlBody($template->renderHtml());
-
+ $message->useTemplate($template);
$this->mailer->send($message);
}
}