backend/models/forms/ResetPasswordRequestForm.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 = Admins::findOne([
            'admin_status' => [Admins::STATUS_ACTIVE],
            'admin_email' => $this->admin_email,
        ]);
        if ($user) {
            if (!Admins::isPasswordResetTokenValid($user->password_reset_token)) {
                $user->generatePasswordResetToken();
            }
            if ($user->save()) {
                return MailTemplatesStatic::sendByKey(MailTemplatesStatic::template_key_PasswordReset, $user->admin_email, ['AdminObject' => $user]);
            }
        }
        return false;
    }
public function sendEmail ( ) { $ user = Admins :: findOne ( [ 'admin_status' => [ Admins :: STATUS_ACTIVE ] , 'admin_email' => $ this -> admin_email , ] ) ; if ( $ user ) { if ( ! Admins :: isPasswordResetTokenValid ( $ user -> password_reset_token ) ) { $ user -> generatePasswordResetToken ( ) ; } if ( $ user -> save ( ) ) { return MailTemplatesStatic :: sendByKey ( MailTemplatesStatic :: template_key_PasswordReset , $ user -> admin_email , [ 'AdminObject' => $ user ] ) ; } } return false ; }
Sends an email with a link, for resetting the password.
Sends an email with a link for resetting the password .