21 · Email & reminders
Everything is sent from the planner’s own mailbox over SMTP (worker/src/mailbox.js, TCP sockets from the Worker, IMAP 993 / SMTP 465 over TLS). There is no separate email provider. Sender name: EMAIL_FROM_NAME (default “Wedding Team”).
Email guests
“Compose once, choose who gets it. One email per household, addressed to everyone in it.”
| Step | Details |
|---|---|
| Subject | required (“Add a subject first”) |
| Message | Plain text, or HTML (“Advanced: full HTML, wrapped in the wedding-brand shell when sent.”) |
| Merge tags | {name}, {code}, {rsvp_url}, {rsvp_button}, replaced per household |
| Audience | Everyone (all households with an email) · Not replied yet (RSVP pending) · Confirmed (coming) · Declined · a specific household (“Select a household…”) |
| Preview recipients | “Preview who’ll receive this before sending — the send shows a final confirmation with the count.” (GET /api/email/audience) |
| Preview | live rendered preview, Desktop / Mobile, in a sandboxed iframe, shown with sample data (“Sample Guest”) (POST /api/email/campaigns/preview) |
| Send test to us | sends the draft to your own inbox (“Test draft sent to your inbox ✓”, POST /api/email/campaigns/test-draft) |
| Send | POST /api/email/campaigns |
Every email uses a polished HTML brand template, with a plain-text fallback and the RSVP button working in non-HTML clients.
Send history
“Every digest, guest email and RSVP reminder run — with per-recipient status.” Each send is an email_campaigns row (kind couple_reminder / guest_campaign / rsvp_reminder, audience, recipient count, status sent / partial / failed, dry-run flag, rendered HTML snapshot) plus one email_log row per recipient (status, provider id or dry-…, error). Open one to see Recipients and the Rendered email (“No rendered snapshot for this campaign (sent before HTML previews).”). Routes GET /api/email/campaigns, /:id.
Simulation mode
EMAIL_DRY_RUN=1: “Simulation mode is on — this will be logged as if sent, but no emails are delivered.” Rows are marked simulated.
The morning brief (to the couple)
“Written each morning by your assistant from the plan.” * Sent automatically at DAILY_BRIEF_TIME UK time (default 08:00), on the first 15-minute cron run at or after it, once a day. DAILY_BRIEF=off stops it. * Preview today’s (GET /api/email/digest) and Email us now (POST /api/email/digest, “Email the digest now?”). * Claude writes it from the plan. If the model isn’t available (“Off — no Claude API key set”) the plain digest is sent instead. * It goes to the couple’s addresses only, from the mailbox, so they can reply to it to update the plan (“done the florist one”), handled by the email assistant.
What the brief gathers (buildDigest)
| Bucket | Overdue (before today) | Coming up (next 14 days) |
|---|---|---|
Payments still to pay (pending / overdue) |
“£X — item (type) · due date · N days overdue” | “… N days away” |
| Open tasks with a deadline | ✓ | ✓ |
| Supplier confirm-by deadlines | “Confirm |
✓ |
| Open / deferred decisions with a deadline | “Decide: …” | ✓ |
| Appointments | never overdue | “Appointment: title @ location” |
| Events (not cancelled / n/a) | never overdue | “title @ venue” |
Plus RSVP numbers: households replied of total, confirmed and declined guests.
RSVP reminders
From Guest Tools (notebook 11): each reminder emails the household and is logged as an rsvp_reminder campaign.
Settings (read-only on this page)
“Set in Cloudflare → your Worker → Settings → Variables and Secrets. Shown here so you can check them.” (GET /api/email/config): Sends from (the mailbox), Your addresses, Provider, status (Configured / Not configured / “No mailbox set”). Send test to us (POST /api/email/test). Email settings are never stored in the database and can’t be edited in the app.
The page also shows the Email assistant card: recent activity, “Changes made”, and Check mailbox now (notebook 22).