A follow-up goes through three stages: it is queued when something happens, it waits in the outbox until it is due, and it is sent by an hourly sweep — if it still makes sense. Nothing is ever emailed inside the request that triggered it: marking forty orders complete queues forty rows and returns at once.
Stage 1: queueing
When an order changes status (WooCommerce's woocommerce_order_status_changed), every active follow-up whose status matches the new status is considered:
- The order's billing email is the recipient. An order with no billing email is skipped.
- Full edition: a "first order" follow-up is only queued if this order is the customer's earliest by billing email.
- A row is written to the outbox table,
{prefix}gmfu_queue, with the time it becomes due: now plus the delay in hours.
The claim rule, part one: one order is one follow-up. The table has a unique index on (follow-up, kind of subject, subject id). A second status change — an order moved back to processing and completed again — tries to write the same row, the database refuses it, and nothing is queued twice.
Full edition, win-backs. Once a day (gmfu_scan_inactive) the plugin reads the orders placed in the one-day slice exactly Quiet for (days) days ago — not every customer the shop ever had — and queues one row per customer address. Because the row is keyed on the address, one customer gets one win-back from an automation, ever.
Stage 2: waiting
The outbox shows the waiting messages. Nothing is sent early, and a sweep that was missed (a quiet site with no visitors to trigger WP-Cron) is not made up for by sending everything at once: each sweep handles a limited batch — 25 in the free edition, How many to send per hour (default 50) in the full edition — oldest first.
Stage 3: the sweep — judged when it is sent
Every hour (gmfuf_sweep in the free edition, gmfu_sweep in the full edition) each due row is checked again, in this order. If a check fails, the row is called off with the reason written beside it, rather than deleted, so "why was this not sent?" has an answer.
While Send follow-up emails (free) / Send follow-ups (full) is switched off, the sweep sends nothing and calls nothing off: the queue simply waits.
- The follow-up still exists and is switched on — otherwise "The automation was switched off or removed".
- The order still exists — otherwise "The order is gone".
- The address has not unsubscribed — otherwise "The customer unsubscribed".
- The order has not since been refunded, cancelled or failed — otherwise "The order was refunded or cancelled". This needs no condition. A follow-up written for one of those statuses (a message sent when an order is cancelled) is the exception and still goes.
- Full edition, win-backs: the address has not ordered inside the window since — otherwise "The customer has ordered again". This needs no condition either.
- Full edition: every condition still holds, read from the order now — otherwise "No longer matches: condition".
- Free edition: a follow-up that carries conditions — which only the full edition can write — is never queued, and one already queued is called off: "Carries conditions this edition cannot judge". A condition nobody can judge holds the message back rather than sending it to everybody.
The claim rule, part two: one follow-up is one send. Before the mail goes out, the row is claimed with one conditional statement — UPDATE … SET sent_at = … WHERE id = … AND sent_at IS NULL — and the mail is sent only if that statement changed the row. Two overlapping sweeps (a real thing on WP-Cron) cannot both send it. A message held back by the email filter stays claimed, so it is not retried every hour for ever.
The message
- The subject and message have their placeholders filled from the order:
| Placeholder | Becomes |
|---|---|
{first_name} |
The billing first name |
{order_number} |
The order number |
{order_total} |
The order total, formatted in the store currency |
{products} |
The order's item names, comma-separated |
{email} |
The recipient's address |
{site_title} |
Your site title |
{shop_url} |
Your shop page's address |
A placeholder with nothing to fill becomes empty rather than showing.
- It is sent as HTML with
wp_mail(). It does not use WooCommerce's email template, so it looks like an ordinary email from your shop. - An empty subject or message means nothing is sent.
The way out
A follow-up is marketing, and marketing carries a way to stop it. Every message ends with an unsubscribe link:
- The link carries a token computed from the address and your site's own secret keys (
wp_hash()), never the address itself, in the query argumentgmfu_stop. - Following it adds the address to
gmfu_optoutsand shows "You will not receive any more follow-up emails from us." - An unknown token shows exactly the same page, so the link cannot be used to find out who your customers are.
- An address on the list is never sent another follow-up.
The token is made the same way in both editions, so a link emailed by one still works after switching to the other.
Free and full edition together
If the full edition is active, the free edition does nothing. Both read the same outbox, follow-ups and opt-out list. When the free edition saves, any follow-ups after the first and anything only the full edition writes are kept untouched.
