Build Transactional Email Deliverability Core on nextjs-postgres-resend
Production transactional email machinery for a Next.js app: Resend integration behind a provider seam, local suppression list with correct bounce/complaint semantics, signature-verified webhooks, a domain warmup governor, staged DKIM/SPF/DMARC rollout with an automated DNS checker, and a template preview/test harness — with the tests already written.
This build pack is pinned for nextjs-postgres-resend, with verification pending. No pass rate is published until the harness runs it.
nextjs-postgres-resend versions lock
| node | 24.18.1 |
| next | 16.2.12 |
| react | 19.2.8 |
| react-dom | 19.2.8 |
| typescript | 6.0.3 |
| resend | 6.18.1 |
| svix | 1.99.1 |
| pg | 8.22.0 |
| @electric-sql/pglite | 0.5.4 |
| vitest | 4.1.10 |
What you get
Features:
- `sendEmail()` pipeline: suppression check → warmup cap → template render →
Resend send (idempotency-key passthrough) → event log, in that order
- Provider seam (`EmailProvider` interface) — swap Resend for Postmark/SES by
writing one class; a mock provider ships for tests and local dev
- Suppression list in your own Postgres with non-negotiable semantics
(complaints permanent and non-removable; soft bounces never suppressed)
- Svix-signature-verified webhook endpoint, idempotent on the delivery id,
auto-maintaining the suppression list from bounces and complaints
- 45-day warmup ramp table with UTC day accounting; over-cap sends deferred
with their full send input stored, so they are replayable — never dropped
- Staged DMARC rollout (none → quarantine → reject) with a checker CLI that
validates SPF, DKIM, return-path MX, and DMARC live or against fixtures
- Two production templates (welcome, password-reset) with mandatory
plain-text parts, establishing the template pattern
- Plain-SQL migration, append-only email event log for ops/debugging
- Full vitest acceptance suite on in-process Postgres (PGlite) — no Docker
- One-page human go-live checklist covering the only manual steps
Screens/pages:
- `/dev/emails` — template preview gallery (subject, HTML iframe, text part),
disabled in production
- `POST /api/webhooks/resend` — webhook endpoint (401 on bad signature)
- CLI: `npm run check-dns` — per-record PASS/FAIL report with detail text
Prescribed services
Disclosure: some links on this page are affiliate links. We may earn a commission if you sign up through them, at no extra cost to you. We only link to services the pack actually verified against.