frontend/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 = Users::findOne([
            'user_status' => [Users::STATUS_ACTIVE, Users::STATUS_CONFIRMED],
            'user_email' => $this->user_email,
        ]);
        if ($user) {
            if (!Users::isPasswordResetTokenValid($user->password_reset_token)) {
                $user->generatePasswordResetToken();
            }
            if ($user->save()) {
                return MailTemplatesStatic::sendByKey(MailTemplatesStatic::template_key_PasswordReset, $user->user_email, ['UserObject' => $user]);
            }
        }
        return false;
    }
public function sendEmail ( ) { $ user = Users :: findOne ( [ 'user_status' => [ Users :: STATUS_ACTIVE , Users :: STATUS_CONFIRMED ] , 'user_email' => $ this -> user_email , ] ) ; if ( $ user ) { if ( ! Users :: isPasswordResetTokenValid ( $ user -> password_reset_token ) ) { $ user -> generatePasswordResetToken ( ) ; } if ( $ user -> save ( ) ) { return MailTemplatesStatic :: sendByKey ( MailTemplatesStatic :: template_key_PasswordReset , $ user -> user_email , [ 'UserObject' => $ user ] ) ; } } return false ; }
Sends an email with a link, for resetting the password.
Sends an email with a link for resetting the password .
/* @var $user Users */