Redaxscript\Controller\Reset::_mail PHP Method

_mail() protected method

send the mail
Since: 3.0.0
protected _mail ( array $mailArray = [] ) : boolean
$mailArray array array of the mail
return boolean
    protected function _mail($mailArray = [])
    {
        $urlReset = $this->_registry->get('root') . '/' . $this->_registry->get('parameterRoute') . 'login';
        /* html elements */
        $linkElement = new Element();
        $linkElement->init('a', ['href' => $urlReset, 'class' => 'link-result'])->text($urlReset);
        /* prepare mail */
        $toArray = [$mailArray['name'] => $mailArray['email']];
        $fromArray = [Db::getSetting('author') => Db::getSetting('email')];
        $subject = $this->_language->get('password_new');
        $bodyArray = ['<strong>' . $this->_language->get('password_new') . $this->_language->get('colon') . '</strong> ' . $mailArray['password'], '<br />', '<strong>' . $this->_language->get('login') . $this->_language->get('colon') . '</strong> ' . $linkElement];
        /* send mail */
        $mailer = new Mailer();
        $mailer->init($toArray, $fromArray, $subject, $bodyArray);
        return $mailer->send();
    }