How to Add Conditional Logic to WooCommerce Emails

How to Add Conditional Logic to WooCommerce Emails

Conditional logic might seem daunting as it sounds. But with the built-in support of YayMail for WooCommerce email templates, it is simple.

It allows you to show particular email blocks when the conditions are met. For example, when a specific customer has made a purchase of over $1,000 on your store, a coupon code is automatically sent to them as a thank-you incentive.

And yes, you can run this automated workflow right within the transactional emails.

Did you know that transactional emails have a fairly high open rate, if not the highest?

And more than that, you can personalize the order emails to customers just like how you have optimized your product page and checkout process.

Let’s dive in!

Getting started

To start with, Email Conditional Logic is an add-on to the YayMail plugin and it can be used along with either YayMail Free or Pro version.

Types of conditional logic in WooCommerce email template

In the email editor, choose a custom block and you’ll see the condition logic option on the left panel.

You can choose to display the element, ie. email block, if the following conditions in the block editor are met.

Email conditional logic in YayMail WooCommerce

There are various types of conditional logic built-in YayMail Addon:

  • Order total minimum
    Eg: IF the customer spends more than $1,000; THEN send him/her a coupon code
  • Order total maximum
    Eg: IF the customer spends less than $500 and more than $400; THEN send him/her a voucher with expiry time
  • Billing country
    Eg: IF the country of billing address is United States; THEN send them additional information on related events
  • Product category
    Eg: IF the ordered items belong to a specific category; THEN send them cross-sale items using images or instructions using Youtube videos/Instagram posts
  • Payment method
    Eg: IF the payment method is Stripe; THEN send them additional announcements

Our use cases are just surface examples, there are a lot of interesting ways you can use conditional logic in the order confirmation emails/completed emails to serve your goals. You’ll be able to apply multiple conditions in one set of dynamic rules to target the audience more efficiently!

Conditional discounts for WooCommerce

In this section, we’ll show you how to offer discounts when the purchased order requirements are met. You can send the discount details in default WooCommerce emails, and also in custom order status emails, too!

Assuming you want to send discount code only to those who have spent between $500 and $1,000 on your shop.

Firstly, create a coupon code with your custom discount amount in WooCommerce > Coupons.

Create WooCommerce coupon code

Then, add a custom text block to the order confirmation email template and paste your new coupon code.

Add coupon code to email template

Scroll down within the text block editor, you will see the option to Display this element if. This is where you can easily add conditions as your criteria.

For order total between $500 and $1,000, we can set it as Order total minimum is 500, and Order total maximum is 999. Then click Save to finish the conditional logic setup.

Conditional discount in transactional emails

With this conditional discount, you can encourage the customers to come back to your store and become loyal customers for your upcoming campaigns as well.

Additional content based on product category

This is by far one of the greatest ways to provide your customers and subscribers with a very fulfilling experience. Especially when they buy products from a specific category. You can get email notifications automatically accompanied by further instructions around those purchased products.

Conditional logic on product category in email template

Not only this helps boost your website traffic, but it also attracts buyers to your other media content like Youtube videos, Instagram posts, and other social sharing platforms. Most importantly, the flow is optimized and directs the customers to the right content for them.

Wrapping up

Consumers want to stick with brands that connect with them on a more personal, human level.

By making use of conditional logic in WooCommerce email communications, you can easily add personally relevant content and increase purchase intent.

Do you have any other ideas on conditional logic types? Can’t wait to hear and implement it in emails!

Just leave us a message on the chatbox below. We’ll come back as soon as possible, and who knows, maybe both of us can work on it and bring a much better online shopping experience to your customers!

Related Posts