The getOrderNotificationTokens hook is invoked each time when order notifications
are triggered, for instance on checkout or order status update. It can be used to
update the values of simple tokens or add custom ones.
Parameters
Isotope\Model\ProductCollection\Order $order
The order object.
array $tokens
The notification center tokens.
Return values
Return array of notification tokens with their values
Example
// src/EventListener/Isotope/PostAddProductToCollectionListener.php
namespaceApp\EventListener\Isotope;useIsotope\Model\ProductCollection\Order;useIsotope\ServiceAnnotation\IsotopeHook;/**
* @IsotopeHook("postAddProductToCollection")
*/classPostAddProductToCollectionListener{publicfunction__invoke(Order$order,array$tokens):array{// Add ##first_product## token that displays the name of the first product in cart
$products=$order->getItems();$firstProduct=reset($products);$tokens['first_product']=$firstProduct->getName();return$tokens;}}