In Mage_Sales_Model_Order_Status_History
you can see that the setIsCustomerNotified
method suppresses the notification if you specify the null
parameter or the value of the constant Mage_Sales_Model_Order_Status_History::CUSTOMER_NOTIFICATION_NOT_APPLICABLE
. Confusingly, using false
will send a notification.
Magento order status update without sending e-mail notifications to the client
This code block works - revises the status of the order, adding a comment that is visible only on the backend and will not cause a notification to the client:
$historyItem = $order->addStatusHistoryComment('some comment', 'complete'); $historyItem->setIsVisibleOnFront(false); $historyItem->setIsCustomerNotified(Mage_Sales_Model_Order_Status_History::CUSTOMER_NOTIFICATION_NOT_APPLICABLE); $historyItem->save(); $order->save();
source share