Email Decision Tree

Twelve steps to WooCommerce Follow-up Email happiness.

1. Product Matches ↑ Back to top

Exact product matches are processed first, followed by always_send product matches.

  1. Look for specific product matches that are always_send=off and email_type!=storewide
  2. Skip date emails that have send dates in the past
  3. Store remaining matches sorted by priority as $emails

2. “Always Send” Product Matches ↑ Back to top

always_send product matches run through the same process as above but with always_send property set to on and that matches are stored as $always_prods.

3. “Always Send” Category Matches ↑ Back to top

All product categories in the given order are pulled and stored in $all_categories. always_send category emails are loaded first before the category emails with always_send=off

  1. Search for emails that matches any of the category in $all_categories
  2. Skip date emails that have send dates in the past
  3. Store remaining matches sorted by priority as $always_cats

4. Process “Always Send” Product Matches ↑ Back to top

Before adding all $always_prods emails to the queue, the code first checks for and queues reminder emails.

After processing and queuing any reminder emails, the emails inside $always_prods are then inserted into the queue.

5. Process “Always Send” Category Matches ↑ Back to top

This is a straight-forward process of looping through the $always_cats array and adding items to the email queue.

6. Process Exact Product Matches ↑ Back to top

  1. Get the email with the highest priority and insert it into the email queue
  2. Loop through the other emails and add to queue if the product IDs are the same with the top email
  3. For the remaining emails, add them to the queue if the scheduled send date is within 60 minutes. Otherwise, ignore the email

7. Process Category Matches ↑ Back to top

  1. Get the email with the highest priority and insert it into the email queue
  2. Loop through the other emails and add to queue if the category IDs are the same with the top email
  3. For the remaining emails, add them to the queue if the scheduled send date is within 60 minutes. Otherwise, ignore the email

8. Storewide All Product Emails ↑ Back to top

A Storewide email will only be processed if no other emails have been queued for a given order. An exception to this rule is if the always_send property is set to on.

Other plugins or add-ons (e.g. Subscriptions) can prevent FUE from sending any storewide emails for a particular order by hooking to the fue_order_created action and returning a boolean true.

  1. Load all storewide emails
  2. Skip emails that have exclude_categories set when an excluded category matches a category in $all_categories
  3. Also skip date emails that have send dates in the past
  4. Insert the remaining storewide emails to the email queue

9. First Purchase & Product Purchase Above One ↑ Back to top

Product Match ↑ Back to top

  1. Loop through the order items and get the number of times the current customer have purchased item
  2. If it is the first time, load and queue all first_purchase emails that matches the current order item ID
  3. If it is not the first time, load and queue all product_purchase_above_one emails that matches the current order item ID

Category Match ↑ Back to top

  1. Loop through the categories and get the number of times the current customer have purchased items under the categories
  2. If it is the first time, load and queue all first_purchase emails that matches the current category ID
  3. If it is not the first time, load and queue all product_purchase_above_one emails that matches the current category ID

10. Storewide First Purchase ↑ Back to top

If the customer is a first-time purchaser, load all first_purchase emails that are generic and add them to the queue

11. Customer Emails ↑ Back to top

Load all customer emails and depending on the email triggers, add to the queue all emails that matches the email’s filter (e.g. total purchases > 3).

12. Customer Emails Last Purchased ↑ Back to top

Load all customer email with the trigger after_last_purchase and automatically add them all to the email queue.

WooCommerce - the most customizable eCommerce platform for building your online business.

Back to the top