Building a Follow-up Email Series with AI Agents: the Follow-up Emails Case Study
I wanted a short series of emails after someone gets one of my plugins: a quick win on day one, the headline feature the next day, and so on until they’ve seen the parts that matter. Every store owner wants this, and most of them end up paying for a follow-up extension to get it.
I already had an email engine (Super Speedy Emails), so I didn’t want another plugin with its own cron, tables and templates. I wanted a small add-on that tells the engine three things: who is due, which step, and what it says. This is the story of how AI agents built that add-on, Follow-up Emails for Super Speedy Emails (a premium add-on), the changes it needed in Super Speedy Emails itself, the bugs the build found on the way, and the first series it will send, a five-email onboarding course for Super Speedy Performance Analysis Pro owners.
Developer detail appears where it explains a decision. The full API is in the Automated Support Emails Developer Guide and the Developer Reference: Filters & Actions.
Available since Super Speedy Emails 1.38.0 (the per-step extension points). Follow-up Emails 0.1.3 needs Super Speedy Emails 1.38.1 or later.
Table of Contents
- The problem
- Why a support-email type and not Automations
- “Not sooner than” by default
- “Exactly on day N”, for the steps that need a date
- The four rules a step has to pass
- Adding the settings to Super Speedy Emails
- How the work was split between agents, and where I decided
- What went wrong
- Why these defaults
- The first series: Performance Analysis onboarding
- Doing the same with your AI
The problem
A follow-up series sounds trivial. Step 1 a day after purchase, step 2 the day after, and so on. The trouble is in the edges, and the edges are where emails silently never send:
- Cron misses a day, or the site is down, and the “day 3” email’s day passes without it.
- You pause the series to fix a typo and lose a day of sends.
- You launch it to people who bought months ago. Every one of them is past every step’s date.
- Someone owns two products with a series each and gets both on the same morning.
- You rehearse the series in test mode, and the rehearsal counts as real sends.
The build has an answer, and a test, for each of them.
Why a support-email type and not Automations
Super Speedy Emails has two ways to send something timed. Automations are drips: a person enrols on an event and steps fire at offsets from that enrolment. Support email types are rules: every day the engine walks the owners of a product and asks a type whether each one should get an email today, and which.
Automations looked like the obvious fit, and an earlier design note of mine even said timed sequences should use them. Reading the code said otherwise. Automations time steps from enrolment, not purchase, so they can’t include people who bought before the automation existed. They don’t check the previous step was really sent. And after downtime they release overdue steps a minute apart (more on that below). This series needed the opposite on every count:
- Backfill: everyone who already owns the product gets the series too.
- Delay from purchase, not from when the series was set up.
- Strict order: step N only after step N-1 was actually sent.
- One a day, at most.
Support email types get backfill for free: the engine walks the product owners table, with each owner’s first and most recent purchase dates, so people who bought a year ago are in the audience on the first run.
“Not sooner than” by default
This is the most important decision in the whole add-on, and the one I’d tell you to copy.
Every step has a minimum age: step 3 set to 3 days means “not sooner than 3 days after purchase”. It goes on the first daily run where it’s allowed. It never has one exact date.
“Exactly 3 days after purchase” breaks the moment one run doesn’t happen. The engine runs each record once per local day after its send hour, and a missed whole day is skipped, not replayed. With “exactly”, that step is gone for that person, for good. With “not sooner than”, a missed day, a paused record or a late launch becomes a short delay.
It also makes backfill work. Someone who bought 200 days ago is past every step’s minimum, so on the first run they’re due step 1, and only step 1, because of strict order. Then one step a day until they’ve caught up.
The test suite proves this both ways. When the delay check is deliberately changed to “exactly N days”, the backfill test fails (“backfilled owner got nothing on day 1”) and so does the downtime test (“nothing after downtime”). That’s the whole argument in two lines of test output. The Not Sooner Than vs Exactly On article goes into it properly.
“Exactly on day N”, for the steps that need a date
Some emails are only right on one day. A renewal reminder 14 days before a yearly licence ends is wrong on day 352 and useless after day 365. “Your 20% off ends on Friday” can’t go on Saturday. For those, a step can be set to Exactly on day N instead of Not sooner than day N, and the two can be mixed in one series.
An exact step goes only on the daily run whose date, in the site’s timezone, is the purchase date plus N days. If that run doesn’t happen, because cron or the server was down, or because the person bought before the step existed, they never receive that step. Nothing replays it and nothing records the miss: on every run the add-on works out from the dates which exact steps have passed, so editing a step’s day re-evaluates everyone straight away. A missed step never blocks the steps after it.
The editor says this under the choice, and the text changes with it:
- Exactly on: “Goes only on day N. If that day’s run doesn’t happen (cron or the server was down), or the customer bought before this email existed, they never receive this step.”
- Not sooner than: “Goes on day N, or on the first run after it if that day was missed. Customers who bought before this email existed still receive it.”
Three rules decide what happens when an exact step meets the others. I made the first two calls; the third follows from them.
- An exact step wins its day. If someone is still catching up on not-sooner-than steps when an exact step’s day arrives, the exact step goes that day and the catch-up step goes the next day. The order breaks for that person, and they still get every step.
- An exact step ignores the spacing rules, both “minimum days between steps” and “one follow-up per person per day”, so a person can get two follow-ups on its day.
- An exact send still counts as that day’s follow-up for other series’ not-sooner-than steps, which wait a day. And one record still sends a person at most one email a day: if two exact steps of the same record fall on one day, the first goes and the second is missed.
Backfill shows how the two kinds combine. Someone who bought 200 days before a series with exact steps on days 30 and 90 and a renewal reminder on day 365 goes live gets every not-sooner-than step, one a day, misses days 30 and 90, and gets the renewal reminder on day 365. A series is complete when every step is sent or missed.
Choose exactly only when the email is wrong on any other day. For onboarding and education, a late email is still worth sending, so the Performance Analysis series below is all not-sooner-than. Exact steps also need the record to run every day: a record scheduled for weekdays only misses any exact step whose day falls at a weekend.
sse-follow-up/describe-series lists each missed step with the reason exact_day_missed and the date it was due, so an AI agent can explain why someone never got it.
Underneath, this needed one more piece of Super Speedy Emails. By default the engine picks a person’s next step by counting how many it has sent, which stops working once a step can be skipped: with steps 1 and 3 sent and 2 missed, the count says step 3. A type can declare a next_stage callback that returns the step to send, and the add-on’s callback is the rule above.
The four rules a step has to pass
A not-sooner-than step N goes to a person on the first daily run where all four hold:
- Every step before it has been sent to this person, or missed (an exact step whose day passed).
- The purchase is at least step N’s delay old.
- At least the minimum gap (default 1 day) has passed since the last step sent.
- With One follow-up per person per day on, this person hasn’t had another follow-up today, from any series or product.
An exact step skips rules 3 and 4, and replaces rule 2 with “today is day N” (see above). Once every step is sent or missed the series never emails that person again, even after a repeat purchase.
Rule 1 reads the engine’s own record of what was sent, not a copy the add-on keeps. Two lists can disagree about which step is next; one can’t. That lookup runs once per owner on every run, so Super Speedy Emails also gained two email log indexes for per-recipient lookups. They’re built by a background WP-Cron job after an update rather than during an admin page load, with an admin notice if the build fails.
Rule 4 had a subtlety. The engine plans every product of a record before it sends to any, so a check on product B can’t see product A’s email from the same run, because it hasn’t been sent yet. The fix was in the engine: it reports the recipients the run has planned but not queued. A core test proves it, red with that part disabled (two products, both sent), green with it on.
Adding the settings to Super Speedy Emails
The add-on doesn’t build a settings screen. It declares its options and the Super Speedy Emails editor draws them, saves them, validates them on every write path (the editor, a config import, an AI agent over MCP) and hands them back resolved.
Per-record options go in admin_fields, which existed. Per-step options needed something new, so Super Speedy Emails gained stage_fields (options shown inside each step’s editor and stored with that step) and max_stages (the admin chooses how many steps, up to a ceiling or, with SSE_Support_Types::UNLIMITED_STAGES, with none). This is the real declaration from the add-on:
'stages' => self::DEFAULT_STAGES, // 5
'max_stages' => SSE_Support_Types::UNLIMITED_STAGES, // -1: no step limit
'stage_fields' => array(
'timing' => array(
'type' => 'select',
'label' => __( 'When this step goes', 'sse-addon-follow-up-emails' ),
'description' => self::timing_help( self::TIMING_AFTER ),
'default' => self::TIMING_AFTER,
'options' => array(
array( 'value' => self::TIMING_AFTER, 'label' => __( 'Not sooner than', 'sse-addon-follow-up-emails' ) ),
array( 'value' => self::TIMING_EXACT, 'label' => __( 'Exactly on', 'sse-addon-follow-up-emails' ) ),
),
),
'delay_days' => array(
'type' => 'number',
'label' => __( 'Day (after purchase)', 'sse-addon-follow-up-emails' ),
'description' => '',
// One default per step; steps past the list take its last entry.
'default' => array( 1, 2, 3, 4, 5 ),
),
),
A small script in the add-on lays the two fields out as one sentence in each step, “[Exactly on / Not sooner than] day [N] after purchase”, and swaps the help text when the choice changes. The add-on reads a step’s values with $context->stage_setting( 'timing', $index ) and $context->stage_setting( 'delay_days', $index ). The per-step default list was the add-on agent’s request: its first version had one default for every step and treated 0 as “use the step number”, which is the kind of magic value that bites someone later. The Adding Your Own Settings article covers both kinds of field.
How the work was split between agents, and where I decided
I wrote a one-paragraph request. A coordinating agent read the code, wrote a plan with the questions it couldn’t answer, and stopped. I answered four:
- Support-email type, not Automations.
- The add-on is private and premium.
- The Performance Analysis series in a set order, with delays of 1, 2, 3, 4 and 5 days.
- Every existing Performance Analysis owner gets step 1.
Then the work split four ways:
| Who | What |
|---|---|
| Coordinator | Reproduced three suspected core bugs on main before anything was designed around them, and opened private issues for the confirmed ones |
| Agent A | The core changes in Super Speedy Emails, on a feature branch with its own test site, with red-green tests and a SQL review |
| Agent B | The add-on, on its own test site, built against the core interface |
| Agent C | The five Performance Analysis emails, in my voice |
| Agent D | These articles |
The trick that let A and B run in parallel was writing the core interface contract into the plan first: the exact function names, argument shapes and return shapes. B built against the contract while A built the contract. When B found gaps (per-step default lists, planned-but-unsent recipients, records with copy only in their steps), they went back to A as three additions rather than as private workarounds in the add-on.
B was also told to build the add-on the way an outside developer’s AI would: public API only. The add-on checks the Super Speedy Emails version and that the core functions it needs exist and, if they don’t, doesn’t register its type at all, so the engine refuses to send any follow-up record. Fail closed, never send step 4 by accident.
Some things stayed with me. The core branch changed handwritten SQL, so it couldn’t merge until I’d approved the SQL review; I did, and it merged as Super Speedy Emails 1.38.0. Whether Automations should space out overdue steps after downtime was a behaviour change, so that was mine to decide too (see issue #15 below). So were the timing questions that came later, which are under Why these defaults.
What went wrong
The rule on every one of these: prove the bug before fixing it. A suspicious line of code is a hypothesis. Each bug below got a test that failed for the stated reason first.
Purchase dates in the wrong timezone (issue #13). Purchase dates are stored in the site’s timezone and were read as UTC. On a New York site, a purchase 20 hours ago read as 25 hours old, so “bought within 0 days” left the buyer out. Fixed in core 1.27.0. The add-on’s first version made the same mistake in the due times it reported (not in what it sent). A test on a Pacific/Auckland site pins the fix: read the date as UTC and the due times come out 13 hours late.
Rehearsals used up real steps (issue #14). The engine counted every log row when picking a step, test mode or not. Two log-only rehearsals then going live meant the first real email anyone got was Step 3. The engine counts steps separately per send mode, so a rehearsal has its own track.
Copy only in the steps sent nothing (issue #16). A record created over MCP with its copy only in its steps planned “no content” and never sent. The admin editor hid this by copying step 1 into the record on save. The add-on build found it, because it creates records the way an agent would.
Automations release overdue steps a minute apart (issue #15). The Automations article promised “You won’t get three emails at once”. After three days of dead cron, three overdue steps arrived on three consecutive one-minute ticks. The code did what its mechanism said, so the article was corrected first. Then I decided overdue steps should be spaced out. Super Speedy Emails 1.38.2 adds Settings > Advanced > Space out overdue Automation steps after downtime, on by default: each overdue step waits its normal gap after the previous one instead of arriving a minute later. The Automations & Onboarding Drips article describes both settings.
The database clock day boundary. The core agent spotted a suspicious comparison in the per-day guard, couldn’t reproduce a user-visible problem, and left it alone. The add-on’s test site deliberately keeps the machine’s database clock at UTC+2 rather than forcing UTC, and its case 11 reproduced it: a step sent at 23:00 UTC yesterday is stored as 01:00 today, the guard thinks it went today, and today’s step is skipped. Any send between 22:00 and 24:00 UTC on such a server lost the next day. The same fault hit the frequency cap and Automations step timing. Fixed in Super Speedy Emails 1.31.0 (issue #18): those comparisons are made as Unix timestamps, so the database clock’s offset doesn’t matter.
New records in the editor. A new record renders as the changelog type until it’s saved once, and that first save copies the changelog default subject (“Updates available for {product_name}”) into step 1. The browser journey test found both. Fixed in Super Speedy Emails 1.28.0 (issue #17): a new record switches to the chosen type’s steps and fields straight away, and only the changelog type gets the starter copy.
The other half of “prove it” is negative controls. A green test proves nothing until you’ve watched it go red for its reason. The add-on has 18 cases. For each one that guards an add-on check, a script breaks that check, runs the case and requires a failure, restores the code and requires a pass. All 17 did. The exception is case 11, which reproduces the core database clock defect above rather than guarding anything in the add-on. The Testing an Email Series Without Sending an Email article shows how.
Why these defaults
Defaults are decisions most people never revisit, so here is what each one is, and which ones I decided:
- Not sooner than, unless a step is set to Exactly on. “Not sooner than” was the plan’s rule from the start, for the reasons above. On 4 November I asked for the other kind as well, a step that goes only on its day, because some series are tied to dates (3, 6, 9 and 12 months after purchase). Either kind can be used for any step, and one series can mix them.
- An exact step wins its day (my answer on 4 November). When it is due while an earlier not-sooner-than step is still catching up, the exact step goes and the catch-up step goes the next day.
- An exact step ignores the minimum gap and one-per-day (my answer on 19 November). A person can get two follow-ups on an exact step’s day.
- Delays of 1, 2, 3, 4, 5 days. That’s the schedule I chose for the Performance Analysis series, and a new record starts with it.
- Minimum gap of 1 day. Someone a year behind gets one step a day while they catch up.
- Count from the first purchase. A repeat purchase doesn’t move the dates the steps count from.
- Bundle-only owners left out unless you tick Also email people who bought this product as part of a bundle. I asked for this option on 19 November, as an opt-in. Unticked, someone who owns the product only through a bundle doesn’t get the series.
- One follow-up per person per day, on. One a day at most was part of the original request. Someone with two series due on the same day gets the second the next day.
- 5 steps to start, no limit. On 19 November I decided there’s no maximum number of steps: a new series starts with five, and the admin adds as many as the course needs.
Launching a Series to Existing Customers covers how these combine on launch day.
The first series: Performance Analysis onboarding
The first series is for people who own Super Speedy Performance Analysis Pro. It walks them through the parts that matter, one step a day: a first analysis, Plugin Impact Analysis, function-level profiling, the cache checks, and running it from an AI agent.
| Step | Not sooner than | Subject |
|---|---|---|
| 1 | 1 day | Your first Performance Analysis Pro run |
| 2 | 2 days | Which plugin is actually slowing your site down? |
| 3 | 3 days | From “this plugin is slow” to the exact function |
| 4 | 4 days | Is your page cache serving new visitors? |
| 5 | 5 days | Run Performance Analysis Pro from Claude Code or Codex |
Because existing owners are backfilled, none of the copy says when they installed it. “Yesterday” would be wrong for most of them. And none of the emails uses {first_name}: an owner with no recorded first name gets “Hi ,” from a bare placeholder, so every step opens “Hi,”.
In the browser journey test, an owner who bought 200 days ago got steps 1 to 5 on days 1 to 5, one a day, and nothing on days 6 and 7.
The copy describes Performance Analysis Pro 0.68.0, where Pro installs its profiler on activation, so the series stays switched off until that version is released to customers.
Doing the same with your AI
You don’t need my add-on to copy the approach. You need the pattern: let the email engine own the machinery, and give your add-on the rules.
Prompt to give your AI
Read the Super Speedy Emails Automated Support Emails Developer Guide and the
Developer Reference: Filters & Actions in the Super Speedy knowledge base, and the
Follow-up Emails case study. Build a separate add-on plugin that registers a
Support Email type for <your series>. Rules: each step is "not sooner than N days
after purchase", strictly in order using SSE_Support_Emails::sent_stages(), at most
one per person per day. Declare per-step options with stage_fields. If a step
can be skipped, declare a next_stage callback that picks the step. Do not edit
any file inside the super-speedy-emails folder. Test with real WooCommerce orders
in log-only mode, and make every test fail once for its stated reason before you
trust it.
If you only want to configure a series rather than build one, your agent can do it over MCP with the draft-support-rule and update-support-rule abilities and check progress with sse-follow-up/describe-series. Letting Your AI Agent Set Up a Series over MCP walks through it.
Letting your AI schedule every step for an exact date. It passes every test you write on a day when cron runs, and quietly loses emails on the first day it doesn’t. Keep exact days for the emails that are wrong on any other day.
Further reading
Written for Super Speedy Emails 1.38.2.
Comments