source/Core/Email.php
public function sendForgotPwdEmail($emailAddress, $subject = null)
    {
        $result = false;

        $shop = $this->_addForgotPwdEmail($this->_getShop());

        $oxid = $this->getUserIdByUserName($emailAddress, $shop->getId());
        $user = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
        if ($oxid && $user->load($oxid)) {
            // create messages
            $smarty = $this->_getSmarty();
            $this->setUser($user);
            $this->_processViewArray();

            $this->_setMailParams($shop);
            $this->setBody($smarty->fetch($this->_sForgotPwdTemplate));
            $this->setAltBody($smarty->fetch($this->_sForgotPwdTemplatePlain));
            $this->setSubject(($subject !== null) ? $subject : $shop->oxshops__oxforgotpwdsubject->getRawValue());

            $fullName = $user->oxuser__oxfname->getRawValue() . " " . $user->oxuser__oxlname->getRawValue();
            $recipientAddress = $user->oxuser__oxusername->getRawValue();

            $this->setRecipient($recipientAddress, $fullName);
            $this->setReplyTo($shop->oxshops__oxorderemail->value, $shop->oxshops__oxname->getRawValue());

            if (!$this->send()) {
                $result = -1; // failed to send
            } else {
                $result = true; // success
            }
        }

        return $result;
    }
public function sendForgotPwdEmail($emailAddress, $subject = null)
    {
        $result = false;

        $shop = $this->_addForgotPwdEmail($this->_getShop());

        $oxid = $this->getUserIdByUserName($emailAddress, $shop->getId());
        $user = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
        if ($oxid && $user->load($oxid)) {
            // create messages
            $smarty = $this->_getSmarty();
            $this->setUser($user);
            $this->_processViewArray();

            $this->_setMailParams($shop);
            $this->setBody($smarty->fetch($this->_sForgotPwdTemplate));
            $this->setAltBody($smarty->fetch($this->_sForgotPwdTemplatePlain));
            $this->setSubject(($subject !== null) ? $subject : $shop->oxshops__oxforgotpwdsubject->getRawValue());

            $fullName = $user->oxuser__oxfname->getRawValue() . " " . $user->oxuser__oxlname->getRawValue();
            $recipientAddress = $user->oxuser__oxusername->getRawValue();

            $this->setRecipient($recipientAddress, $fullName);
            $this->setReplyTo($shop->oxshops__oxorderemail->value, $shop->oxshops__oxname->getRawValue());

            if (!$this->send()) {
                $result = -1; // failed to send
            } else {
                $result = true; // success
            }
        }

        return $result;
    }
public function sendForgotPwdEmail ( $ emailAddress , $ subject = null ) { $ result = false ; $ shop = $ this -> _addForgotPwdEmail ( $ this -> _getShop ( ) ) ; $ oxid = $ this -> getUserIdByUserName ( $ emailAddress , $ shop -> getId ( ) ) ; $ user = oxNew ( \ OxidEsales \ Eshop \ Application \ Model \ User :: class ) ; if ( $ oxid && $ user -> load ( $ oxid ) ) { // create messages $ smarty = $ this -> _getSmarty ( ) ; $ this -> setUser ( $ user ) ; $ this -> _processViewArray ( ) ; $ this -> _setMailParams ( $ shop ) ; $ this -> setBody ( $ smarty -> fetch ( $ this -> _sForgotPwdTemplate ) ) ; $ this -> setAltBody ( $ smarty -> fetch ( $ this -> _sForgotPwdTemplatePlain ) ) ; $ this -> setSubject ( ( $ subject !== null ) ? $ subject : $ shop -> oxshops__oxforgotpwdsubject -> getRawValue ( ) ) ; $ fullName = $ user -> oxuser__oxfname -> getRawValue ( ) . " " . $ user -> oxuser__oxlname -> getRawValue ( ) ; $ recipientAddress = $ user -> oxuser__oxusername -> getRawValue ( ) ; $ this -> setRecipient ( $ recipientAddress , $ fullName ) ; $ this -> setReplyTo ( $ shop -> oxshops__oxorderemail -> value , $ shop -> oxshops__oxname -> getRawValue ( ) ) ; if ( ! $ this -> send ( ) ) { $ result = - 1 ; // failed to send } else { $ result = true ; // success } } return $ result ; }
Sets mailer additional settings and sends "forgot password" mail to user.
Returns true on success.

@param string $emailAddress user email address
@param string $subject      user defined subject [optional]

@return mixed true - success, false - user not found, -1 - could not send
Sets mailer additional settings and sends forgot password mail to user . Returns true on success .