订单确认电子邮件在 Magento 1.9.3.2 中不起作用

Order confirmation emails not working in Magento 1.9.3.2

我的网站上线了,订单确认电子邮件既没有发送给客户也没有发送给管理员。我正在使用 Magento 1.9.3.2。

请检查 Cron jobs 是否在工作,您可以通过安装 AOE SCHEDULER 扩展轻松检查,确保您在 System > Configuration > Advanced > System > Cron 中有正确的设置还要检查您是否在 System > configuration> Sales> Sales email > Order emails.

中输入了发件人电子邮件

补充一下,开箱即用的 cronjobs 已在 Magento 中预先配置,但您需要在服务器的 cron 选项卡上设置实际作业。

在 SSH 中打开 crontab;

crontab -e

添加这个;

### MAGENTO CRON ###
*/1 * * * * cd /path/to/magento/ && sh cron.sh

已将 /path/to/magento 替换为您的实际安装路径。

Magento 允许 2 种方式发送电子邮件,如下所示:

1) 使用 cron 2) 避免 cron

如果你不想使用 cron,请使用以下更改:

在 - app/code/core/Mage/Sales/Model/Order 打开你的 order.php 文件。php

并更改:

//$mailer->setQueue($emailQueue)->send(); **// Comment this code.**

至:

$mailer-> send();

注意 : 以上更改不是磁电机的标准方式,因此请实现文件覆盖方式。

转到:app/design/frontend/base/default/template/checkout/success.phtml:

在文件代码的顶部添加以下代码:

$order = Mage::getModel('sales/order');
$incrementId = Mage::getSingleton('checkout/session')->getLastRealOrderId(); 
$order->loadByIncrementId($incrementId);
try
{ 
  $order->sendNewOrderEmail();
} 
catch (Exception $ex) 
{ 
  echo "Email Not Sent..."; 
}
$customer = Mage::getSingleton('customer/session')->getCustomer();
$email = $customer->getEmail();