Transactional email flows

Build reliable welcome emails, booking confirmations, payment receipts, and reminders with idempotent triggers and clear monthly plan quotas.

How transactional email architecture works

A reliable transactional email is never triggered directly by a browser button click. Users double-click submit buttons, refresh thank-you screens, and lose mobile signal mid-checkout — causing either duplicate emails or silently missing receipts.

Instead, every transactional email should fire strictly as a server-side side effect of a verified state change in your Cloud database or an authenticated Stripe webhook. Separating the state change from the delivery step guarantees that receipts match paid orders and never duplicate on retries.

text
[Verified Server Event]  (e.g., Stripe checkout.session.completed or booking confirmed)
          |
          v
[Check Idempotency Ledger]  -> Key already exists ("receipt:ord_1042")? Stop safely.
          | (New key)
          v
[Render Multipart Template] -> Clean HTML + plain-text fallback + local timezone
          |
          v
[Send via Verified Domain]  -> Records delivery ID and timestamp in email_deliveries

Keeping transactional flows strictly separate from promotional newsletters also safeguards your sender reputation. High-intent receipts and booking confirmations consistently achieve high open rates, teaching Gmail and Outlook to prioritize mail from your domain.

Monthly limits and capabilities across ExaSpark plans

Every ExaSpark plan includes managed transactional email so authentication works immediately on day one. As your app graduates from early prototypes to live customer receipts and reminders, plan tiers expand monthly send quotas, custom sender domains, and log retention.

PlanMonthly email allowanceAllowed email typesCustom sending domainsLog retentionBehavior at monthly cap
Free ($0/mo)100 / monthAuth only (verification, password resets, magic links)0 (default ExaSpark sender)7 daysPauses until next monthly cycle
Starter ($4.99/mo or $3.99/mo annual)1,000 / monthAuth + custom app emails (receipts, bookings, alerts)1 custom domain7 daysOverage allowed without blocking orders
Pro ($25/mo or $20/mo annual)10,000 / monthAuth + full custom transactional notificationsUp to 3 custom domains30 daysOverage allowed without blocking orders

Core email flows every revenue app needs

Most SaaS tools, booking studios, and shops need six core transactional flows. Specify the exact trigger, dynamic fields, and unique idempotency key for each flow before building.

Email flowServer triggerEssential fieldsIdempotency key
WelcomeAccount verifiedSign-in link, account email, first actionwelcome:<user_id>
Booking confirmedDeposit webhookService, local time + zone, venue, deposit, balancebooking_confirmed:<booking_id>
Stripe receiptcheckout.session.completed / invoice.paidOrder number, line items, total, Reply-Toreceipt:<stripe_id>
24h reminderHourly scheduled checkLocal appointment time, directions, reschedule rulereminder_24h:<booking_id>
Team inviteAdmin creates inviteInviter, workspace, role, expiring linkinvite:<invite_id>
Failed renewalinvoice.payment_failedPlan, grace window, Customer Portal linkdunning:<invoice_id>

Preventing duplicate sends with idempotent triggers

Stripe webhooks use at-least-once delivery, and scheduled jobs occasionally overlap during deployments. Without idempotency guards, a single paid order can send a customer three identical receipts in ten seconds.

Create an email_deliveries table with a UNIQUE constraint on idempotency_key. Insert the key before calling the mail API; if the database rejects a duplicate key, return cleanly without sending again.

json
{
  "id": "em_01J9Z8Q4M1",
  "idempotency_key": "booking_confirmed:bkg_7402",
  "template_name": "booking_confirmation",
  "recipient_email": "maya@example.com",
  "status": "sent",
  "sent_at": "2026-11-18T16:04:12Z"
}

Handling time-based reminders without drift

Never match an exact minute (slot_start == now + 24h) for appointment or trial reminders — if a job runs two minutes late, it skips the booking silently.

Run an hourly check for confirmed bookings where slot_start falls between 23 and 25 hours ahead and reminder_24h_sent_at IS NULL, recording both the timestamp and reminder_24h:<booking_id>. See Scheduled jobs & automation.

Designing templates that pass spam filters and convert

Anatomy of a high-trust transactional email

  • Recognizable sender and `Reply-To`. Send from your verified domain (Studio North <bookings@mail.studionorth.co>) with a real Reply-To (hello@studionorth.co) rather than noreply@.
  • Multipart HTML + plain text. Always pair clean HTML with a plain-text fallback so spam filters never penalize image-heavy templates.
  • Explicit local timezones. Store UTC in Cloud, then render dates in the venue or user timezone (Thu, Nov 19 at 2:00 PM EST).
  • Direct domain links only. Point every CTA straight to your verified domain (https://studionorth.co/bookings/7402) without third-party URL shorteners.
  • Essential facts first. Place confirmation status, date/amount summary, and one clear button at the top without promotional banners.

Implementing your email suite step by step

  1. Verify your sending domain

    Complete SPF, DKIM & DMARC setup on Starter or Pro before enabling custom app emails.

  2. Add an `email_deliveries` ledger

    Store unique idempotency_key, template_name, recipient_email, status, and sent_at for auditability and deduplication.

  3. Wire server-only triggers

    Fire receipts from Stripe webhooks, welcomes from auth verification, and reminders from hourly checks — never unauthenticated browser forms.

  4. Test templates in Preview

    Send every flow to personal Gmail and Outlook inboxes, checking mobile wrapping, timezones, and plain-text fallbacks.

  5. Audit live delivery logs

    Check Cloud → Email → Logs (7 days on Free/Starter, 30 days on Pro) during launch week to catch typos and bounces.

Starter prompt · App

Build a transactional email suite backed by an `email_deliveries` table with a unique `idempotency_key` column so retries never duplicate emails. Send HTML + plain-text emails from `Studio North <bookings@mail.studionorth.co>` (`Reply-To: hello@studionorth.co`) for four server events: (1) booking confirmation on Stripe `checkout.session.completed` with local EST time, venue address, deposit paid, balance due, and manage link; (2) hourly 24-hour reminder guarded by `reminder_24h_sent_at`; (3) itemized order receipts; and (4) failed-renewal alerts on `invoice.payment_failed` linking to Stripe Customer Portal.

Troubleshooting missed, duplicated, or delayed emails

SymptomMost likely root causeReliable fix
Custom receipt never sentProject is on Free (100/mo auth-only)Upgrade to Starter (1,000/mo) or Pro (10,000/mo)
Duplicate receipts receivedWebhook retried without an idempotency_key guardCheck unique idempotency_key in email_deliveries before sending
Wrong appointment hourServer formatted raw UTC instead of local timezoneConvert UTC to venue IANA timezone (America/New_York) and show zone label
24h reminder skipped slotsJob checked an exact minute instead of a windowQuery slot_start between 23h and 25h ahead where reminder_24h_sent_at IS NULL
Log shows `Hard bounce`Customer mistyped their email at checkoutSuppress retries to hard-bounced addresses and allow email edits on account settings
Mail lands in SpamHeavy banners, missing plain text, or missing DMARCStrip marketing bloat, add plain-text body, and verify SPF/DKIM/DMARC

Next steps

Still have a question?Ask our team and other builders on Discord.

From the blog