diff --git a/common/models/Customer.php b/common/models/Customer.php index 33e935e..019da3a 100755 --- a/common/models/Customer.php +++ b/common/models/Customer.php @@ -1,7 +1,7 @@ urlManager->createAbsoluteUrl(['site/reset-password', 'token' => $user->password_reset_token]); +?> +
+

Hello username) ?>,

+ +

Follow the link below to reset your password:

+ +

+
\ No newline at end of file diff --git a/frontend/controllers/LoginController.php b/frontend/controllers/LoginController.php index 7c2fba8..7a2db8c 100755 --- a/frontend/controllers/LoginController.php +++ b/frontend/controllers/LoginController.php @@ -38,6 +38,12 @@ class LoginController extends Controller $model = new Customer; if(!empty($_POST['Customer']['username'])){ if($user = Customer::find()->where(['username'=>$_POST['Customer']['username']])->one()) + Mailer::widget( + ['type' => 'password', + 'subject'=> 'Ваш пароль', + 'email' => $user->email, + 'params' => $user, + ]); $user->sendMsg(); Yii::$app->getSession()->setFlash('success', 'На указанный Вами эмейл отправленно письмо с паролем!'); return $this->refresh(); -- libgit2 0.21.4