How do Smart Order Notifications rules work and how do they interact?
As discussed in our Triggers & Filter's guide, Smart Order Notifications uses rules to determine when to send an notification (or include it in a batch) and which line items to include in the notification. These rules are configured using the Triggers & Filters form in the notification edit screen.
Both sections of the form function and behave in the same manner. First they ask for a field, then an operator and finally a value. The three in combination make up a rule.
Product SKU is equal to ABC123
In the rule above breaks down like so:
Field: Product SKU Operator: is equal to Value: ABC123
Our rule matcher uses these elements to determine if the order matches your rule or not. In the case of our example we would look at each line item on the order and check if any of their product SKUs are equal to "ABC123". If it finds a match, the order will trigger a notification or will be included in the batch.
Triggers determine which orders should send a notification or be included in a match.
Filters determine which line items should be sent in the notification.
Think of this process as a funnel. At the top of the funnel triggers check which orders qualify to send a notification. At the bottom of the funnel filters weed out line items that are not relervant. This gives you complete control over when the notification sends and what it contains.
At the top of each rule form you have control over whether Smart Order Notifications should match all conditions of the rule or any condition of the rule. See example below:
How do these condition options work?
This ensures that all the conditions you create must be true in order for the notification to be sent or the line item to be included.
The any conditions option means that if one or more of the conditions you create are true then the notification will be sent or the line item will be included.
Using the all conditions option is powerful when you want to match very specific order states, for example: an order with a product with a certain SKU, with a destination country of the USA and a customer tag of VIP.
On the other hand, the any condition will allow you to create much broader rules. For example: any order with one of 15 different product types or any order with a destination postal code that contains "BA1".
Mixing Any and All It's not possible to mix any and all rules. Allowing you to combine these rule types is a feature we have on our roadmap. This will allow you to create rules that match one of many postal codes and a destination country of United Kingdom (for example). However, currently you have to choose between any and all.