cancel
Showing results for 
Search instead for 
Did you mean: 

Order emails not working

SOLVED

Order emails not working

I have been trying everything to get order emails to work on a new Magento 1.9.2.1 installation. Depsite everything being enabled under System > Configuration > Sales > Sales Emails and setting up a proper cron in cPanel, nothing ever happens. I have setup the same exact cron in cPanel for another installation and it works fine. Nothing I do seems to matter. Nothing ever gets populated in the cron_schedule table and the core_email_queue table has the email there (with nothing in the "processed_at" field).

 

I'm desperately trying to get this store online tonight... can anyone help me?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Order emails not working

Oddly, when I copied the cron.php and cron.sh from another installation in a subfolder of the account, it started working normally. I really don't know why the original files caused this behavior; the permissions and ownership of the files were identical, as were the contents.

View solution in original post

7 REPLIES 7

Re: Order emails not working

This actually is now resolved. It looks like an Mage_Core_Exception was causing the problem. Once i took care of it it... presto, everything works. Smiley Happy

Re: Order emails not working

Actually this is not solved. After the cron_schedule was initially populated, it sent out the previously-queued emails... but new emails are NOT sent and all the "pending" scheduled tasks from a couple days ago still show as pending. Also, there is nothing in the logs now.

Re: Order emails not working

Oddly, when I copied the cron.php and cron.sh from another installation in a subfolder of the account, it started working normally. I really don't know why the original files caused this behavior; the permissions and ownership of the files were identical, as were the contents.

Re: Order emails not working

Magento had set the order email to be sent by schedule job instead of instant email.

If your mail system(smtp, zend_mail) works fine; disabling mailQueue may solve your problem.

Change Line 407

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

 

to

if (false /\*$this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue\*/) {

Re: Order emails not working

Where do we find this script?

Re: Order emails not working

its in 

app/code/core/Mage/Core/Model/Email/Template.php

 

and just add an exclamation mark before $this->hasQueue() so it reads
if (!$this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) {

works fine now for me Magento ver. 1.9.2.1 CE

Re: Order emails not working

Changing to this "if (!$this->hasQueue() && $this->getQueue() instanceof Mage_Core_Model_Email_Queue) {" worked for me. I am now receiving orders via email. I'n not sure if it was this change or changes to my cronjob in go daddy cpanel. I will post them below as it my help someone else:

 

php /home/printer/yourdomainname.com/cron.sh > /dev/null

wget -O /dev/null -q http://www.yourdomainname.com/cron.sh > /dev/null

php /home/printer/yourdomainname.com/cron.php > /dev/null

wget -O /dev/null -q http://www.yourdomainname.com/cron.php > /dev/null