# Next.js boilerplate with Postmark

> Transactional email through Postmark, behind one provider-agnostic send function. React Email templates are rendered to HTML and text before sending. Transactional and broadcast mail use separate message streams. The suppression list is mirrored from Postmark's own. A basic-auth webhook handles bounces, spam complaints and subscription changes.

Transactional email with separate broadcast streams and 45 days of history.

- **Category:** Email
- **Pricing:** Free developer plan: 100 emails a month, no expiry. Paid plans start at $15/month for 10,000 emails. Every plan keeps 45 days of message history by default. Dedicated IPs (from $50/month) and longer retention are add-ons.
- **Best for:** Products where the transactional mail has to arrive now: sign-in links, password resets, receipts. Also teams that send some marketing and want it kept on separate infrastructure from the mail that must not fail.
- **Conflicts with:** resend, mailgun
- **Vendor docs:** https://postmarkapp.com/developer

## Trade-offs

- Transactional first. Broadcast streams exist and handle unsubscribes, but there is no segmentation, no drip builder and no marketing CRM.
- Postmark does not sign webhooks. The endpoint is protected by basic auth over HTTPS, which works but puts the credential in the webhook config.
- No React rendering on Postmark's side. Templates are rendered to HTML and text in the app before sending, so the preview is exactly what ships.
- No idempotency key on the API. This battery sets a deterministic Message-ID and stores the key as metadata instead.
- New accounts go through a short approval before they can mail outside their own domain. Plan a day for it before launch.

## Known fixes it ships

- [Postmark bounce and spam complaint webhooks, secured without a signature](https://agenticboilerplate.com/cookbook/postmark/bounces-complaints-and-webhook-auth): Postmark does not sign webhooks. Protect the endpoint with basic auth, act only on deactivating bounces, and make every write an upsert.
- [Postmark DKIM and custom Return-Path, and why DMARC fails without them](https://agenticboilerplate.com/cookbook/postmark/dkim-return-path-dns): Postmark needs two DNS records per domain. DKIM signs the mail. The pm-bounces Return-Path CNAME makes SPF align. Skip one and DMARC alignment rests on the other.
- [Postmark error 406: you tried to send to a recipient that has been marked as inactive](https://agenticboilerplate.com/cookbook/postmark/inactive-recipient-406): A 406 means Postmark deactivated the address after a hard bounce, complaint or manual block. Do not retry it. Surface it, and reactivate only on the owner's request.
- [Postmark message streams, transactional vs broadcast, and why the split protects your login emails](https://agenticboilerplate.com/cookbook/postmark/message-streams-transactional-vs-broadcast): Postmark sends transactional and broadcast mail through separate streams with separate reputations and suppression lists. Route every send on purpose, and never put marketing on the transactional stream.
- [Postmark server-side templates vs React Email rendered in your app](https://agenticboilerplate.com/cookbook/postmark/postmark-templates-vs-react-email): Postmark can store templates and fill them with Mustachio. Rendering React Email in your app keeps templates in the repo, typed and reviewed. How to choose, and what each costs.
- [Testing Postmark without emailing anyone, POSTMARK_API_TEST vs sandbox servers vs bounce-testing](https://agenticboilerplate.com/cookbook/postmark/testing-with-postmark-api-test-and-sandbox): Postmark has three ways to send without reaching a real inbox. Each tests something different. Pick by what you need to prove.

## Generate it

[Build a repo with Postmark](https://agenticboilerplate.com/build?b=postmark)

---

Agentic Boilerplate: A Next.js repo your agent already knows. Free during launch, then $99 once.

- Site map for agents: https://agenticboilerplate.com/llms.txt
- Public API: https://agenticboilerplate.com/openapi.json
- Contact: agenticstudio@gmail.com
