Campaign Follow-ups & Controls
Engagement follow-ups, mailing-list To, and the unsubscribe policy on POST /campaigns.
/campaignsThree optional controls extend a campaign beyond the base fields.
Engagement follow-ups
Up to 5 followups send automatically after the campaign finishes — each fires delay later to the recipients matching its condition, threaded as a reply to their original email (same conversation; subject defaults to Re: <campaign subject>). Bodies support the same merge tags as the campaign.
| Field | Description |
|---|---|
condition | One of opened, clicked, not_opened, not_clicked, replied, not_replied. |
delay | Natural-language duration after the send completes, e.g. "5 hours", "4 days" (max 30 days). |
subject | Optional; defaults to Re: <campaign subject> to keep the thread. |
html | The follow-up body (required). |
Mailing-list To
Set list_to: true and every message shows a generated recipient-<hex>@your-domain address as the visible To header. Delivery is unchanged — each mail is still sent individually to its real recipient.
Unsubscribe policy
| `unsubscribe_policy` | Behavior |
|---|---|
account (default) | Any opt-out blocks the recipient — today's behavior. |
domain | Only opt-outs recorded for THIS sending domain (plus account-wide ones) block. An unsubscribe from one of your other domains does not. |
ignore | The unsubscribe list is skipped. Hard-bounced and complained addresses are ALWAYS excluded regardless. |
ignore only where you have a lawful basis to email recipients who opted out.A/B winning metric
The ab_test.metric now accepts reply in addition to open and click — the winner is the variant with the higher reply rate (replies are matched from your inbound mail).
import { MailBlastr } from 'mailblastr';
const mb = new MailBlastr('mb_xxxxxxxxx');
const { data, error } = await mb.campaigns.create({
"domain": "yourdomain.com", "from": "You <you@yourdomain.com>",
"subject": "Big news", "html": "<p>Hi {{name}} …</p>",
"list_to": true,
"unsubscribe_policy": "domain",
"ab_test": { "enabled": true, "subject_b": "Bigger news", "test_pct": 20, "metric": "reply" },
"followups": [
{ "condition": "not_opened", "delay": "5 hours", "html": "<p>Bumping this…</p>" }
]
});
console.log({ data, error });