Not Sooner Than vs Exactly On: Scheduling Follow-up Emails That Survive Downtime
Ask anyone to describe a follow-up series and they’ll say “email them 3 days after they buy”. Build exactly that and it works on every day your cron runs. The first day it doesn’t, someone’s day-3 email disappears and nothing tells you.
This article explains the rule that keeps timed email from silently going missing: by default, a step has a minimum age, not an exact date. The one exception, a step that is only right on one day, has its own section. The examples come from Follow-up Emails, a premium add-on for Super Speedy Emails, and the Follow-up Emails case study tells the story of how it was built.
Available since Super Speedy Emails 1.38.0. Follow-up Emails needs Super Speedy Emails 1.38.1 or later.
The question people actually ask
It’s never “is my schedule well designed?”. It’s “Why did half my customers never get the second email?” The answer is nearly always that the email was due on one specific day and that day’s run didn’t happen.
How a daily run really behaves
Super Speedy Emails runs Support Emails from an hourly cron. Each active record runs once per local day, after its send hour. If a whole day is missed (the site was down, WP-Cron didn’t fire because nobody visited, the record was paused), that day is skipped. It is not replayed the next morning.
That’s the right behaviour for the engine. Replaying missed days would mean a site that comes back from a week of downtime sends a week of email at once. But it means the type decides what “due” means, and it has to cope with days that never happen.
“Exactly” loses email
Here’s what “exactly N days after purchase” does to each of the normal things that happen to a real site:
| What happens | “Exactly 3 days” | “Not sooner than 3 days” |
|---|---|---|
| Cron misses day 3 | Never sent | Sent on day 4 |
| Record paused for a week | Every step due that week is lost | Each step goes when the record resumes, one a day |
| Series launched to people who bought last year | Nobody qualifies, ever | Everyone starts at step 1 |
The third row is the one that surprises people. If you launch a series to customers who bought months ago, every one of them is past every step’s date. “Exactly” sends them nothing. Not a short delay, nothing at all.
The rule
In the Follow-up Emails add-on, a not-sooner-than step N goes on the first daily run where:
- every step before it has been sent to this person (or missed, see Exactly on day N),
- the purchase is at least step N’s delay old,
- at least the minimum gap has passed since the last step sent,
- and, with One follow-up per person per day on, this person has had no other follow-up today.
Rule 2 is the “not sooner than”. On its own it would be dangerous: someone 200 days past purchase meets every step’s minimum at once. Rules 1 and 3 are what make it safe. Strict order means only the lowest unsent step can ever be due, and the gap means one step per day at most. So the 200-day-old owner gets step 1 on the first run, step 2 the next day, and so on. A missed day pushes everything back a day and loses nothing.
In the add-on the delay check is one comparison:
} elseif ( $owned['days'] < $state['delay_days'] ) {
$state['reasons'][] = self::reason( 'too_soon_after_purchase', /* ... */ );
$due_at[] = $owned['ts'] + $state['delay_days'] * DAY_IN_SECONDS;
}
“Less than the delay: not yet.” There’s no upper bound, and that’s the point.
Proving it, both ways
Writing “not sooner than” in a design doc proves nothing. The add-on’s test suite has two cases that only pass because of it:
- Backfill: an owner who bought 200 days ago gets step 1 only on day 1, then exactly one step a day.
- Missed days: four days without a run, then step 1 only, then one a day until caught up.
Then the negative control. A script swaps the delay check for “exactly N days” and runs both cases again. Both must fail, and both do:
01-backfill exact-day-delay red: FAIL day 1: backfilled owner gets step 1 only expected=["Step 1 of 5: FU Backfill"] actual=[]
04-missed-days exact-day-delay red: FAIL after 4 missed days: step 1 only expected=["Step 1 of 4: FU Missed"] actual=[]
That’s the whole argument for this article in two lines of test output. Testing an Email Series Without Sending an Email explains how those tests move time without waiting for it.
Exactly on day N
Everything above argues against exact dates, and for most follow-ups that holds. A few emails are the exception, because they are wrong on any other day:
- a renewal reminder, timed against the day a yearly licence ends,
- a dated offer (“20% off until Friday”),
- anything that refers to a specific day the reader will see on a calendar.
Sending those late is worse than not sending them. So each step in Follow-up Emails has a timing: Not sooner than day N (the default) or Exactly on day N, and a series can mix the two.
An exact step goes only on the daily run whose date, in the site’s timezone, is the purchase date plus N days. There is one run per local date, so “day N” is one run, not a 24-hour window. There is no grace day. If that run doesn’t happen, or the customer bought before the step existed, missed means never: the step is skipped for that person for good. The editor says so under the choice:
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.
Nothing is stored for a miss. On every run the add-on works out from the dates which exact steps have passed, the same way it works out what was sent from the engine’s log, so changing a step’s day re-evaluates everyone. A missed step never blocks the steps after it: the next step is the first one neither sent nor missed, and the series is complete when every step is sent or missed.
Mixing the two kinds needs these rules:
| Situation | What happens |
|---|---|
| An exact step’s day arrives while an earlier not-sooner-than step is still catching up | The exact step goes that day; the catch-up step goes the next day |
| “Minimum days between steps” or “One follow-up per person per day” would block an exact step | The exact step ignores both, so a person can get two follow-ups that day |
| Two exact steps of the same record fall on the same day | The first goes; the second is missed, because one record sends a person at most one email a day |
| An exact step went today and another series has a not-sooner-than step due | The exact send counts as today’s follow-up; the other step waits a day |
Backfill still works for the not-sooner-than steps. Someone who bought 200 days ago, launched into a series with exact steps on days 30 and 90 and a renewal reminder on day 365, gets every not-sooner-than step one a day, misses days 30 and 90, and gets the reminder on day 365.
Two practical points:
- An exact step needs a run on its day, so schedule the record for every day. A weekdays-only schedule misses every exact step that falls at a weekend.
sse-follow-up/describe-seriesreports each missed step with the reasonexact_day_missedand the site-local date it was due.
The add-on’s suite covers this both ways too: an exact step goes on its day and not the day before; a step whose day had no run is never sent while the next step still goes; a 200-day backfill skips the passed exact steps; and a series whose last step is missed completes. Each has a negative control. Treating exact steps as never missed, for example, makes the missed-day case send its day-3 step a day late, on day 4.
Days have boundaries, and boundaries have timezones
A “minimum age in days” needs a clock, and three clocks are involved:
- Purchase dates are stored in the site’s timezone (they come from the WooCommerce order’s local date). Read as UTC, a New York purchase from 20 hours ago looks 25 hours old. Use the engine’s
days_since_firstanddays_since_last, which read them in the site’s timezone, rather than parsing the dates yourself. - The add-on’s “one a day” and “minimum gap” count UTC calendar days, so every site gets the same rule whatever its timezone. An exact step’s day is the exception: it is a date in the site’s timezone, because that is the calendar the customer and the store owner read.
- The database writes its own timestamps, and the database server’s clock isn’t always UTC. On a server at UTC+2, a step sent at 23:00 UTC is stored as 01:00 the next day. Compared as a string with a UTC midnight, it looks as if it went “today”, and today’s step is skipped. Super Speedy Emails’ per-day guard, frequency cap and Automations timing compare these times as Unix timestamps, so the database clock’s offset doesn’t change the answer. A test site that keeps the machine’s real database clock, rather than forcing UTC, shows whether your own code gets this right.
Compare times as Unix timestamps or in one stated timezone, and say which in the code. A string compare between a database DATETIME and a gmdate() string is only correct when the database clock happens to be UTC.
What about Automations?
Super Speedy Emails’ Automations time each step from enrolment, not purchase, so they only reach people who enrol after the automation exists. After downtime, Settings > Advanced > Space out overdue Automation steps after downtime (on by default) makes each overdue step wait its normal gap after the previous one; with it off, overdue steps go on consecutive one-minute ticks. The Automations & Onboarding Drips article has the details. That suits a drip triggered by a sign-up. For a series that includes past buyers and counts from the purchase, the support-email rule above is the better fit.
Prompt to give your AI
For every timed email step, use a minimum age ("not sooner than N days after
<anchor>") unless the email is wrong on any other day; only then use an exact
day, and treat a missed exact day as never sent. Only the lowest unsent step may be due, read from
SSE_Support_Emails::sent_stages(), and at most one step per person per day. Use the
context's days_since_first / days_since_last instead of parsing purchase dates.
Add a test where the cron misses four days, and a negative control that changes the
delay check to "exactly N days" and must make that test fail.
Further reading
Written for Super Speedy Emails 1.38.2.
Comments