selfhosted/models/forms/PasswordResetRequestForm.php
/**
     * Sends an email with a link, for resetting the password.
     *
     * @return boolean whether the email was send
     */
Sends an email with a link, for resetting the password.
@return boolean whether the email was send
Sends an email with a link for resetting the password . @return boolean whether the email was send
public function sendEmail()
    {
        $user = SelfHostUsers::findOne([
            'shu_email' => $this->user_email,
        ]);
        if ($user) {
            if (!SelfHostUsers::isPasswordResetTokenValid($user->password_reset_token)) {
                $user->generatePasswordResetToken();
            }
            if ($user->save()) {
                return MailTemplatesStatic::sendByKey(MailTemplatesStatic::template_key_PasswordReset, $user->shu_email, [
                    'user_name' => $user->shu_name,
                    'user_email' => $user->shu_email,
                    'app_name' => Yii::getAlias('@selfHostedDomain'),
                    'reset_password_link' => Yii::$app->urlManager->createAbsoluteUrl(['site/reset-change-password', 'token' => $user->password_reset_token]),
                ]);
            }
        }
        return false;
    }
public function sendEmail ( ) { $ user = SelfHostUsers :: findOne ( [ 'shu_email' => $ this -> user_email , ] ) ; if ( $ user ) { if ( ! SelfHostUsers :: isPasswordResetTokenValid ( $ user -> password_reset_token ) ) { $ user -> generatePasswordResetToken ( ) ; } if ( $ user -> save ( ) ) { return MailTemplatesStatic :: sendByKey ( MailTemplatesStatic :: template_key_PasswordReset , $ user -> shu_email , [ 'user_name' => $ user -> shu_name , 'user_email' => $ user -> shu_email , 'app_name' => Yii :: getAlias ( '@selfHostedDomain' ) , 'reset_password_link' => Yii :: $ app -> urlManager -> createAbsoluteUrl ( [ 'site/reset-change-password' , 'token' => $ user -> password_reset_token ] ) , ] ) ; } } return false ; }
Sends an email with a link, for resetting the password.
Sends an email with a link for resetting the password .
/* @var $user SelfHostUsers */ //'shu_status' => [SelfHostUsers::STATUS_ACTIVE, SelfHostUsers::STATUS_CONFIRMED],