Esempio n. 1
0
 public function actionSendEmail()
 {
     $model = new SendEmailForm();
     if ($model->load(Yii::$app->request->post())) {
         if ($model->validate()) {
             if ($model->sendEmail()) {
                 Yii::$app->getSession()->setFlash('warning', 'Проверьте емайл.');
                 return $this->goHome();
             } else {
                 Yii::$app->getSession()->setFlash('error', 'Нельзя сбросить пароль.');
             }
         }
     }
     return $this->render('sendEmail', ['model' => $model]);
 }
Esempio n. 2
0
 public function actionSendEmail()
 {
     $model = new SendEmailForm();
     if ($model->load(Yii::$app->request->post())) {
         if ($model->validate()) {
             if ($model->sendEmail()) {
                 Yii::$app->getSession()->setFlash('warning', Yii::t('app', 'Link to the password recovery has been sent to your email.'));
                 return $this->goHome();
             } else {
                 Yii::$app->getSession()->setFlash('error', Yii::t('app', 'You can not reset the password.'));
             }
         }
     }
     return $this->render('sendEmail', ['model' => $model]);
 }