Twelve steps to WooCommerce Follow-up Email happiness.
1. Product Matches
↑ Back to top
- Look for specific product matches that are
always_send=off
andemail_type!=storewide
- Skip date emails that have send dates in the past
- Store remaining matches sorted by
priority
as$emails
2. “Always Send” Product Matches
↑ Back to topalways_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_categories
. always_send
category emails are loaded first before the category emails with always_send=off
- Search for emails that matches any of the category in
$all_categories
- Skip date emails that have send dates in the past
- Store remaining matches sorted by
priority
as$always_cats
4. Process “Always Send” Product Matches
↑ Back to top$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$always_cats
array and adding items to the email queue.
6. Process Exact Product Matches
↑ Back to top- Get the email with the highest priority and insert it into the email queue
- Loop through the other emails and add to queue if the product IDs are the same with the top email
- 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- Get the email with the highest priority and insert it into the email queue
- Loop through the other emails and add to queue if the category IDs are the same with the top email
- 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 topalways_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
.
- Load all storewide emails
- Skip emails that have
exclude_categories
set when an excluded category matches a category in$all_categories
- Also skip date emails that have send dates in the past
- Insert the remaining storewide emails to the email queue
9. First Purchase & Product Purchase Above One
↑ Back to topProduct Match
↑ Back to top- Loop through the order items and get the number of times the current customer have purchased item
- If it is the first time, load and queue all
first_purchase
emails that matches the current order item ID - 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- Loop through the categories and get the number of times the current customer have purchased items under the categories
- If it is the first time, load and queue all
first_purchase
emails that matches the current category ID - 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 topfirst_purchase
emails that are generic
and add them to the queue
11. Customer Emails
↑ Back to topcustomer
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 topcustomer
email with the trigger after_last_purchase
and automatically add them all to the email queue.