简体   繁体   English

Magento 1.9.1.0订单确认电子邮件 - 不发送

[英]Magento 1.9.1.0 Order Confirmation Emails - Not Sending

I've recently upgraded to Magento CE 1.9.1.0 and our order confirmation emails are not being sent to customers or the employees here that are setup to receive notifications. 我最近已升级到Magento CE 1.9.1.0,我们的订单确认电子邮件未发送给设置为接收通知的客户或此处的员工。

I checked the Email Logs and don't see the emails hitting the server at all. 我检查了电子邮件日志,但根本没有看到电子邮件到达服务器。

Emails come through from the Contact Form, New User Account Signup and a few test scripts I created on the server. 电子邮件来自联系表单,新用户帐户注册以及我在服务器上创建的一些测试脚本。 I made sure that Disable Email Communications was set to "No". 我确保禁用电子邮件通信设置为“否”。

Any ideas? 有任何想法吗? They worked great in 1.7.0.2 before we upgraded. 在升级之前,他们在1.7.0.2中工作得很好。

Starting from Magento 1.9 the order confirmation emails are not sent during checkout anymore, instead they are sent with the Cron . Magento 1.9开始,订单确认电子邮件不再在结账时发送,而是与Cron一起发送。 To verify this works properly: 要验证这是否正常:

  • make sure your system Cron is up and running (you can check the Cron logs: /var/log/cron to verify that). 确保您的系统Cron已启动并运行(您可以检查Cron日志: /var/log/cron来验证)。

  • make sure Magento Cron is setup correctly and is running every some minutes. 确保Magento Cron设置正确并且每隔几分钟运行一次。 You should see something like this in the Crontab of your system: 您应该在系统的Crontab中看到类似的内容:

    */5 * * * * /public_html/cron.sh

    This schedules a task to run cron.sh every five minute. 这会安排任务每五分钟运行一次cron.sh ( More reading ) 更多阅读

There are good extensions like AOE Scheduler in Magento that help you to monitor and manage Cron jobs. 像Magento中的AOE Scheduler这样的好的扩展可以帮助您监视和管理Cron作业。


An alternative way to this is to disable the Cron for these kind of emails ( order confirmation ). 另一种方法是禁用这些电子邮件的Cron( 订单确认 )。 To do this you can go to this path: 为此,您可以转到此路径:

public_html/app/code/core/Mage/Sales/Model/Order.php

Copy that file and bring it to this path (if the path doesn't exist create it): 复制该文件并将其带到此路径(如果路径不存在则创建它):

public_html/app/code/local/Mage/Sales/Model/Order.php

And then change this line: 然后改变这一行:

$mailer->setQueue($emailQueue)->send();

To: 至:

$mailer->send();

However I recommend spending some time to setup the Cron instead. 但是我建议花一些时间来设置Cron。 I think if they wanted to use Cron for these emails it's for a reason. 我想如果他们想将Cron用于这些电子邮件,那是有原因的。

Just do a small change in order.php ( public_html/app/code/core/Mage/Sales/Model/Order.php ) 只需对order.php做一个小改动( public_html/app/code/core/Mage/Sales/Model/Order.php

From

$mailer->setQueue($emailQueue)->send();

To

$mailer->send();

Solution is simple that i found. 我发现解决方案很简单。

go to System -> Configuration -> ASCHRODER EXTENSIONS -> SMTP -> Queue Configuration -> Queue Usage -> Never

Done! 完成!

Order Confirmation will be sent quickly. 订单确认将快速发送。 :) :)

Quick solution is: 快速解决方案是:

Go to the following location: /app/code/core/Mage/Core/Model/Email/Template.php 转到以下位置: /app/code/core/Mage/Core/Model/Email/Template.php

Change Line 407 改变第407行

if ($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) {

To: 至:

if (!($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue)) {

It will work. 它会工作。

Thanks Pankaj 谢谢Pankaj

Please ovewrite 'app/code/core/Mage/Sales/Model/Order.php' file.if you dont want to any changes in xml file so So just copy /app/code/core/Mage/Sales/Model/Order.php into /app/code/local/Mage/Sales/Model/Order.php and be sure to refresh the cache. 如果您不想对xml文件进行任何更改,请填写'app / code / core / Mage / Sales / Model / Order.php'文件。所以只需复制/ app / code / core / Mage / Sales / Model / Order。 php进入/app/code/local/Mage/Sales/Model/Order.php并确保刷新缓存。 and change 并改变

$mailer->setQueue($emailQueue)->send();

To

$mailer->send();

Goto /app/code/core/Mage/Core/Model/Email/Template.php 转到/app/code/core/Mage/Core/Model/Email/Template.php

Below changes : 以下变化:

if ($this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) {

To

if (false){

I had exactly the same problem. 我有完全相同的问题。 For me it was a local copy of the order.php that I had made some changes to in the past and that I had copied to \\app\\code\\local\\Mage\\Sales\\Model\\Order.php. 对我来说,这是order.php的本地副本,我过去曾做过一些更改,并且我已复制到\\ app \\ code \\ local \\ Mage \\ Sales \\ Model \\ Order.php。

Thus, the updated order.php of Magento 1.9.1.0 in the core directory was not in usage - causing the order confirmation emails not to be send automatically via the cron job. 因此,核心目录中更新的Magento 1.9.1.0的order.php未被使用 - 导致订单确认电子邮件不会通过cron作业自动发送。

I keep the fingers crossed that you suffer from the same issue. 我保持手指交叉,你遭受同样的问题。

Just add cron in cpanel or plesk panel. 只需在cpanel或plesk面板中添加cron即可。 It will available on cpanel -> Advanced and click cron folder. 它将在cpanel - > Advanced上提供,然后单击cron文件夹。 Then proceed: 然后继续:

  • */5 in the 'minute' field (may customize this) */5在“分钟”字段中(可以自定义)
  • * in the 'hour' field *在'小时'字段中
  • * in the 'day' field *在'日'字段中
  • * in the 'month' field *在'月'字段中
  • * in the 'weekday' field *在'工作日'字段中

comment: http://www.yoursite.com/absolute/path/to/magento/cron.php 评论: http//www.yoursite.com/absolute/path/to/magento/cron.php

There are many answers but none worked for me. 有很多答案,但没有一个对我有用。 How i solved is that, check that if your default template setup are there in the magento or not. 我是如何解决的,检查你的默认模板设置是否在magento中。 Sometimes during installation its lost and actually "there is no email template by default in system to send your email". 有时在安装过程中它丢失了,实际上“系统默认没有电子邮件模板来发送你的电子邮件”。 Please go to Admin side, System->Transactional Email-> by default you will find no template here. 请到管理员端, System->Transactional Email->默认情况下,您将找不到模板。 So add one by clicking on button ' Add new Email template . 因此,点击“ Add new Email template ”按钮添加一个。 In Load default template panel select a template from the Template drop down suppose forgot Password and click and click Load Template . 在“ Load default template面板中,从“模板”下拉列表中选择一个模板,假设忘记密码并单击并单击“ Load Template As earlier said no email template is associated with it so it will not be show in below. 如前所述,没有与之关联的电子邮件模板,因此不会在下面显示。 The bset thing is to go to install a fresh copy of magento in your local system navigate here and put that same content here and click Save Template button. bset是在本地系统中安装magento的新副本,在此处导航并在此处输入相同的内容,然后单击Save Template按钮。 Then go to System->Configuration->Customer Configuration ->Password Options->Change the 'Forgot Email Template' dropdown to yours as added above .Happy . 然后转到System->Configuration->Customer Configuration ->Password Options->Change上面添加的“忘记电子邮件模板”下拉列表。快乐。 thus same thing you can also do for order ,shipment, new account etc. 因此,您也可以为订单,发货,新帐户​​等做同样的事情。

To debug magento order mail issue regarding new order just run yoursite.com/cron.php If you recieve any mail now then its cron issue. 要调试有关新订单的magento订单邮件问题,请运行yoursite.com/cron.php如果您现在收到任何邮件,那么它的cron问题。 You can fix con issue by setting cron in cpanel. 您可以通过在cpanel中设置cron来修复con问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM