mirror of
https://github.com/elyby/accounts.git
synced 2024-11-26 16:52:02 +05:30
Интегрирован шаблон для письма "забыл пароль"
This commit is contained in:
parent
b67a1879fe
commit
c162a46e62
@ -84,15 +84,20 @@ class ForgotPasswordForm extends ApiForm {
|
||||
throw new InvalidConfigException('Please specify fromEmail app in app params');
|
||||
}
|
||||
|
||||
$acceptor = $emailActivation->account;
|
||||
$account = $emailActivation->account;
|
||||
$htmlBody = Yii::$app->emailRenderer->getTemplate('forgotPassword')
|
||||
->setLocale($account->lang)
|
||||
->setParams([
|
||||
'username' => $account->username,
|
||||
'key' => $emailActivation->key,
|
||||
'link' => Yii::$app->request->getHostInfo() . '/recover-password/' . $emailActivation->key,
|
||||
])
|
||||
->render();
|
||||
|
||||
/** @var \yii\swiftmailer\Message $message */
|
||||
$message = $mailer->compose([
|
||||
'html' => '@app/mails/forgot-password-html',
|
||||
'text' => '@app/mails/forgot-password-text',
|
||||
], [
|
||||
'key' => $emailActivation->key,
|
||||
])
|
||||
->setTo([$acceptor->email => $acceptor->username])
|
||||
$message = $mailer->compose()
|
||||
->setHtmlBody($htmlBody)
|
||||
->setTo([$account->email => $account->username])
|
||||
->setFrom([$fromEmail => 'Ely.by Accounts'])
|
||||
->setSubject('Ely.by Account forgot password');
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
"ely/yii2-tempmail-validator": "~1.0.0",
|
||||
"emarref/jwt": "~1.0.3",
|
||||
"ely/amqp-controller": "^0.1.0",
|
||||
"ely/email-renderer": "dev-master#8c975737c6681af4bbd161ff27fe6326d39ba9d6"
|
||||
"ely/email-renderer": "dev-master#c70ab0d3b0208bb7d61281a166ec7a9c5344eaad"
|
||||
},
|
||||
"require-dev": {
|
||||
"yiisoft/yii2-codeception": "*",
|
||||
|
Loading…
Reference in New Issue
Block a user