Conditional Logic
Show or hide email blocks based on product attributes, order details, and more
With the YayMail Conditional Logic Addon, you can choose to display any elements or WooCommerce blocks in the email when one or more conditions are satisfied.
Here are the options provided in YayMail conditional statements.
2 logical operators:
All: Returns true if all conditions are true.
Any: Returns true if at least one of the conditions is true.
3 comparison types:
is
is not
contains all
And various conditional object properties:
Product
Product category
Product SKU
Minimum order total
Maximum order total
Payment method
Shipping method
Billing country
WooCommerce coupon code
Below you will find an overview table of how it works for a product condition under different cases. The Result column shows the visibility of the email block.
Object | Settings | Order items | Result |
---|---|---|---|
Product | is: A | A | show |
is: A | A, B | show | |
is not: A | A | not show | |
is not: A | B | show | |
is not: A | A, B | not show | |
is not: A, B | A | not show | |
is not: A, B | C | show | |
is not: A, B | A, B | not show | |
contains all: A, B | A | not show | |
contains all: A, B | A, C | not show | |
contains all: A, B | A, B | show |
For instance, you can add a Featured Products section to your email body. And then, create a condition to allow displaying it in emails if the ordered product belongs to a specific category.
By choosing Product category is "Tshirts", you will be able to display these related products when a customer has bought a t-shirt.
With this setup, when a customer buys a t-shirt, they will receive an order confirmation email. This email includes links to other product categories in your shop that you have set. So that you boost the chance of customers visiting your store and further browsing Hoodies/Caps categories.
Other WooCommerce conditional logic options include but are not limited to:
Billing country is/is not
Product category is/is not
Product is/is not
Product SKU is/is not
Minimum order total
Maximum order total
Payment method is/is not
Shipping method is/is not
Coupon codes is/is not
Payment status is/is not
Payment method includes: Direct Bank Transfer, Check Payment, Cash on Delivery, PayPal, Stripe, etc.
Shipping method includes: Flat rate, Free Shipping, Local Pickup, etc.
Payment status includes: Pending Payment, Processing.
Last updated