In Mage with the ASchroder.com SMTP Pro Email extension, I have things properly configured, as far as I can tell, because when an order is placed and the status is pending* I get the order email. However, when the status is immediately processing*, I do not get the order email.

*Immediately set status, no further action taken, either via Magento or the related payment processor gateway.

Is this behavior by default? If yes, how can I set Mage to send email when an order with ANY status is submitted?

2 Answers 2


Just updating the status/state of the order does not trigger any emails to be sent. The most relevant code is in


protected function _setState($state, $status = false, $comment = '', $isCustomerNotified = null, $shouldProtectState = false)
    // attempt to set the specified state
    if ($shouldProtectState) {
        if ($this->isStateProtected($state)) {
            Mage::throwException(Mage::helper('sales')->__('The Order State "%s" must not be set manually.', $state));
    $this->setData('state', $state);

    // add status history
    if ($status) {
        if ($status === true) {
            $status = $this->getConfig()->getStateDefaultStatus($state);
        $history = $this->addStatusHistoryComment($comment, false); // no sense to set $status again
        $history->setIsCustomerNotified($isCustomerNotified); // for backwards compatibility
    return $this;

which does not include any calls to the email sending code. This is usually handled by each individual payment method and can differ substantially. Some will send the order confirmation email, some will send the invoice confirmation email only. If your payment method does not send any emails at all this seems like an oversight during development. For example in

/app/code/core/Mage/Paypal/Model/Express/Checkout.php you will find $order->sendNewOrderEmail() to trigger the email sending part.

If all payment methods are not sending any emails check your email sending settings under System > Configuration > Sales Email if this is not disabled it is time to further check your email configuration and server/Magento error logs for further clues as to why no emails are being sent once you have confirmed what your code is meant to send.


You can use Magento event/observer.
1. Add observer for sales_order_save_after event:


2.Send email in the observer if new order email was not sent already:

class Some_Module_Model_Observer
    public function salesOrderSaveAfter($observer)
         * @var $order Mage_Sales_Model_Order
        $order = $observer->getDataObject();
                $historyItem = Mage::getResourceModel('sales/order_status_history_collection')
                    ->getUnnotifiedForInstance($order, Mage_Sales_Model_Order::HISTORY_ENTITY_NAME);
                //track history
                if ($historyItem) {
            }catch (Exception $e){
                //some exception handling

By the way sales_order_save_after event fires when order status changed via admin panel or payment module and your observer sends email if order confirmation email not sent.

  • Thanks. But is it default behavior NOT to send email when status is processing?
    – Gaia
    Jan 16, 2014 at 9:34
  • 1
    @Gaia, it is not correct behavior. Normally Magento should send automatically one "Order Confirmation Email" when order state changed to processing. Maybe there is some issues with your store configuration, I can't figure out, but you can try the solution given above.
    – mageUz
    Jan 16, 2014 at 10:54
  • How would I go about installing it? I found inchoo.net/ecommerce/magento/…, could I start from there?
    – Gaia
    Jan 23, 2014 at 17:20
  • Seems like you should do some troubleshooting before resorting to building an extension that patches something that should work fine by default. This is a good guide on debugging Magento. magento.stackexchange.com/questions/428/…
    – jesseconnr
    Feb 14, 2014 at 23:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.