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();