Create tpl for reset password mail - refs BT#9897 #TMI

1.10.x
Angel Fernando Quiroz Campos 10 years ago
parent 19f42c313d
commit 0e1f9e5184
  1. 19
      main/inc/lib/login.lib.php
  2. 4
      main/template/default/mail/reset_password.tpl

@ -206,14 +206,21 @@ class Login
Database::getManager()->flush();
$url = api_get_path(WEB_CODE_PATH).'auth/reset.php?token='.$uniqueId;
$mailTemplate = new Template(null, false, false, false, false, false);
$mailTemplate->assign('complete_user_name', $user->getCompleteName());
$mailTemplate->assign('link', $url);
$mailLayout = $mailTemplate->get_template('mail/reset_password.tpl');
$mailSubject = get_lang('ResetPasswordInstructions');
$mailBody = $mailTemplate->fetch($mailLayout);
api_mail_html(
'',
$user->getCompleteName(),
$user->getEmail(),
get_lang('ResetPasswordInstructions'),
sprintf(
get_lang('ResetPasswordCommentWithUrl'),
$url
)
$mailSubject,
$mailBody
);
Display::addFlash(Display::return_message(get_lang('CheckYourEmailAndFollowInstructions')));
//}

@ -0,0 +1,4 @@
<p>{{ 'Dear' }} {{ complete_user_name }}</p>
<p>
{{ 'ResetPasswordCommentWithUrl'|get_lang|format(link) }}
</p>
Loading…
Cancel
Save