summaryrefslogtreecommitdiffstats
path: root/core/Controller
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-04-13 20:02:15 +0200
committerGitHub <noreply@github.com>2017-04-13 20:02:15 +0200
commit81d3732bf51590ca3e3b8abc794d9562346862f5 (patch)
tree0c31d0bd84d07461cb3b439ed256be7f6dc3596c /core/Controller
parentd36751ee38ee3c9994ac6f2e44313b29d893d2f7 (diff)
parent1f962f91154b04c5ec49df14a3e0aa2f4905e1c6 (diff)
downloadnextcloud-server-81d3732bf51590ca3e3b8abc794d9562346862f5.tar.gz
nextcloud-server-81d3732bf51590ca3e3b8abc794d9562346862f5.zip
Merge pull request #4308 from nextcloud/lost-password-email
Update email template for lost password email
Diffstat (limited to 'core/Controller')
-rw-r--r--core/Controller/LostController.php22
1 files changed, 18 insertions, 4 deletions
diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php
index a4768cbeafc..4597124897b 100644
--- a/core/Controller/LostController.php
+++ b/core/Controller/LostController.php
@@ -284,15 +284,29 @@ class LostController extends Controller {
$link = $this->urlGenerator->linkToRouteAbsolute('core.lost.resetform', array('userId' => $user->getUID(), 'token' => $token));
- $tmpl = new \OC_Template('core', 'lostpassword/email');
- $tmpl->assign('link', $link);
- $msg = $tmpl->fetchPage();
+ $emailTemplate = $this->mailer->createEMailTemplate();
+
+ $emailTemplate->addHeader();
+ $emailTemplate->addHeading($this->l10n->t('Password reset'));
+
+ $emailTemplate->addBodyText(
+ $this->l10n->t('Click the following button to reset your password. If you have not requested the password reset, then ignore this email.'),
+ $this->l10n->t('Click the following link to reset your password. If you have not requested the password reset, then ignore this email.')
+ );
+
+ $emailTemplate->addBodyButton(
+ $this->l10n->t('Reset your password'),
+ $link,
+ false
+ );
+ $emailTemplate->addFooter();
try {
$message = $this->mailer->createMessage();
$message->setTo([$email => $user->getUID()]);
$message->setSubject($this->l10n->t('%s password reset', [$this->defaults->getName()]));
- $message->setPlainBody($msg);
+ $message->setPlainBody($emailTemplate->renderText());
+ $message->setHtmlBody($emailTemplate->renderHTML());
$message->setFrom([$this->from => $this->defaults->getName()]);
$this->mailer->send($message);
} catch (\Exception $e) {