Claude Templates / S-tier · Foundation

Infrastructure

The Email Infrastructure Playbook

Postmark, the SPF/DKIM/DMARC recipe, drip campaigns, and transactional vs marketing routing.

EMAIL-INFRASTRUCTURE-PLAYBOOK.md · 16 sections · 3,691 words · 30 KB · markdown

The sending engine. Domain authentication done right the first time, a layout system so every email looks like it came from the same company, drip campaign mechanics, and the routing rule that keeps transactional mail out of the opt-out gate.

What's inside

When to use it

Week 2, before the first lifecycle email goes out.

Build these first

App Infrastructure

Straight from the file

Reference: src/lib/email/postmark.ts — single-file client with sendPostmarkEmail, sendBroadcastEmail, sendThreadedReply, isRetryablePostmarkError.

Table of contents

  1. 0. Use this spec
  2. 1. Architecture
  3. 2. Postmark account setup
  4. 3. DNS auth (SPF + DKIM + DMARC)
  5. 4. Schema
  6. 5. Layout wrapper + marketing-only sentinels
  7. 6. Drip-tick worker
  8. 7. Trigger events + enrollment
  9. 8. Transactional vs marketing routing
  10. 9. Unsubscribe handling (HMAC + one-click)
  11. 10. Postmark events webhook
  12. 11. Inbound mail webhook
  13. 12. Opt-out gating (drip worker side)
  14. 13. Sender resolution + merge context
  15. 14. Common pitfalls
  16. 15. Kickoff prompt

How to run it

Drop EMAIL-INFRASTRUCTURE-PLAYBOOK.md into your repo, then tell Claude Code: “Read EMAIL-INFRASTRUCTURE-PLAYBOOK.md and implement it in this codebase.” It's written for an agent to execute end to end. Search the file for angle-bracket placeholders and swap in your own project names, domains, and keys before the first run.

↓ Download the playbook

More infrastructure playbooks

← All 28 Claude templates