0

I have sendOrderUpdateEmail in my module but this function, some times work and send email and some times,NOT.

I think this work if for example my prev. status was "NEW"

In which status, this function work and send update email to customers?

If I want to send update email for all status, how can I use this method in my module?

I used same as below in my module

$comment = $helper->__("Order status changed to: %s", $newState);
$order->setData('state', $status);
$order->setStatus($order->getConfig()->getStateDefaultStatus($status));
$history = $order->addStatusHistoryComment($comment, false);
$history->setIsCustomerNotified(true);
$order->sendOrderUpdateEmail(true, $comment);
$order->save();

1 Answer 1

0

The most probably it will not help, but check following.

Here is your function:

public function sendOrderUpdateEmail($notifyCustomer = true, $comment = '')
{
    $this->queueOrderUpdateEmail($notifyCustomer, $comment, true);
    return $this;
}

This function calls queueOrderUpdateEmail

/**
 * Queue email with order update information
 *
 * @param boolean $notifyCustomer
 * @param string $comment
 * @param bool $forceMode if true then email will be sent regardless of the fact that it was already sent previously
 *
 * @return Mage_Sales_Model_Order
 */
public function queueOrderUpdateEmail($notifyCustomer = true, $comment = '', $forceMode = false)

In default magento this function calls with forceMode equals true. Maybe you have forceMode = false and according to description the letter will not send if it was sent by somehow.

Also you can try to put some Mage::log inside queueOrderUpdateEmail and determine why is it happening. If you need any help regarding this - just ask.

2
  • I think when we use sendOrderUpdateEmail then forceMode always is true, right?
    – sIiiS
    Commented Apr 22, 2015 at 19:00
  • If there no any rewrite.
    – zhartaunik
    Commented Apr 22, 2015 at 20:50

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.