LemonStand Documentation

shop:onBeforeOrderInternalStatusMessageSent

This event can be used to prevent order status change notifications from being sent to users they would normally be sent to. The event handler accepts two parameters, the order object (Shop_Order class) and order status object (Shop_OrderStatus class). It should return true if the status notification should be sent and false if not.

For example, to prevent the status notification from being sent if the order total is 0 when the order is marked paid: 

public function subscribeEvents()
{
	Backend::$events->addEvent('shop:onBeforeOrderInternalStatusMessageSent', $this, 'process_order_before_internal_message');
}
 
public function process_order_before_internal_message($order, $status)
{
	if ($status->code == Shop_OrderStatus::status_paid && $order->total == 0)
		return false;
	return true;
}

Next: shop:onExtendOrderPreviewToolbar event
Previous: shop:onOrderSupportsInvoices event
Return to Handling LemonStand events