Забудьте, что электронная почта не отправляет письмо клиенту в magento 1, но в коде функция почтовой программы отправила письмо

Я сталкиваюсь с проблемами, связанными с проблемами забытого пароля, в Magneto 1.9. Я использую стандартный пароль для забытого пароля. я также отладил код там в основном файле, функция почтовой отправки отправить письмо, но я не получил его в учетной записи электронной почты.
Кроме того, я создал пользовательский шаблон, забыл пароль и установил его из системы-> Настройки-> Настройки клиента. чем это будет работать. он отправит электронное письмо. но я обеспокоен стандартным шаблоном электронной почты Forgotpassword, почему он не будет отправлять письмо на пользовательский адрес электронной почты.

Я отладил код в основном файле: —
Приложение / код / ​​ядро ​​/ Mage / Клиент / контроллеры / AccountController.php

 public function forgotPasswordPostAction()
{
$email = (string) $this->getRequest()->getPost('email');
if ($email) {

//echo "email".$email;
if (!Zend_Validate::is($email, 'EmailAddress')) {
$this->_getSession()->setForgottenEmail($email);
$this->_getSession()->addError($this->__('Invalid email address.'));
$this->_redirect('*/*/forgotpassword');
return;
}

/** @var $customer Mage_Customer_Model_Customer */
$customer = $this->_getModel('customer/customer')
->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
->loadByEmail($email);

if ($customer->getId()) {
//echo "email".$customer->getID();die;
try {
$newResetPasswordLinkToken =  $this->_getHelper('customer')->generateResetPasswordLinkToken();
$customer->changeResetPasswordLinkToken($newResetPasswordLinkToken);
$customer->sendPasswordResetConfirmationEmail();
} catch (Exception $exception) {
$this->_getSession()->addError($exception->getMessage());
$this->_redirect('*/*/forgotpassword');
return;
}
}
$this->_getSession()
->addSuccess( $this->_getHelper('customer')
->__('If there is an account associated with %s you will receive an email with a link to reset your password.',
$this->_getHelper('customer')->escapeHtml($email)));
$this->_redirect('*/*/');
return;
} else {
$this->_getSession()->addError($this->__('Please enter your email.'));
$this->_redirect('*/*/forgotpassword');
return;
}
}

/app/code/core/Mage/Customer/Model/Customer.php

    protected function _sendEmailTemplate($template, $sender, $templateParams = array(), $storeId = null)
{
/** @var $mailer Mage_Core_Model_Email_Template_Mailer */
$mailer = Mage::getModel('core/email_template_mailer');

$emailInfo = Mage::getModel('core/email_info');
$emailInfo->addTo($this->getEmail(), $this->getName());
$mailer->addEmailInfo($emailInfo);$mailer->setSender(Mage::getStoreConfig($sender, $storeId));
$mailer->setStoreId($storeId);
$mailer->setTemplateId(Mage::getStoreConfig($template, $storeId));
$mailer->setTemplateParams($templateParams);
$mailer->send();
// debug code
if($mailer->send()){
echo "mailer sent";
}else{
echo "not sent";
}
return $this;
}

Может ли кто-нибудь помочь мне решить это.

1

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …