Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send order email from admin not working in Magento 1.8

After upgrading my site from 1.4 to 1.8 I am unable to send order email from the admin panel.

When a new order is placed the customer receives the order email, but when I try to re-send the order email from the admin panel The order email has been sent message displays but neither the customer nor the admin gets the email.

I switched on logging and tried sending the order email, but nothing logs. Has anyone experienced this issue or found any solutions?

like image 932
James Avatar asked Dec 05 '22 06:12

James


2 Answers

Just been looking into this myself. I've followed the code and functions back to this function "public function sendNewOrderEmail()" in:

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

starting at line 1270 is the following code:

$emailSentAttributeValue = $this->load($this->getId())->getData('email_sent');
    $this->setEmailSent((bool)$emailSentAttributeValue);
    if ($this->getEmailSent()) {
        return $this;
    }

This is checking the sales_flat_order db table to see if the email has already been sent to the customer and if so just to return, but this does not send the email and should throw an error. So I would say it is a bug somewhere. To fix it so you can resend order/invoice emails etc..

Copy

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

to

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

and comment out line 1273

if ($this->getEmailSent()) {
            //return $this;
        }

Works a charm for me. But literally only this second tested it.

Tested using ver. 1.8.1

like image 155
ScarletRed Avatar answered Dec 30 '22 01:12

ScarletRed


I also struggled with the problem of order e-mails not being sent in CE 1.9.1 but found the problem after a while:

As of Magento CE 1.9.1 Magento doesn't send order emails directly during the order process. Instead the mails are queued and are sent by the cron. So make sure to configure the Magento cronjob properly.

Also refer to:

http://www.magentocommerce.com/knowledge-base/entry/ee1141-ce191-responsive-email#cron http://www.magentocommerce.com/knowledge-base/entry/ce18-and-ee113-installing#install-cron

like image 38
Gerard de Visser Avatar answered Dec 29 '22 23:12

Gerard de Visser