Claude Templates / A-tier · High leverage
Admin & Ops
The Email Automation Console Playbook
The operator half of email — campaigns, templates, enrollments, analytics.
EMAIL-AUTOMATION-CONSOLE-PLAYBOOK.md · 18 sections · 5,795 words · 47 KB · markdown
Email Infrastructure is the engine; this is the cockpit. Six management pages, fourteen admin API routes, a condition DSL for skip and exit rules, and the lifecycle workers that keep enrollments moving — so you can edit a campaign without editing code.
What's inside
- //Six console pages: campaigns, campaign editor, templates, layout, enrollments, analytics
- //Fourteen admin API routes, fully specified
- //A condition DSL for skip_if / exit_goal rules
- //Lifecycle, expiry, and lead-nurture workers
- //Manual campaign fire + cohort operations
- //Seed campaigns to start from
When to use it
After the email engine and admin shell exist.
Build these first
Straight from the file
Primary button is the global .btn.btn-solid class (orange fill, pill radius, color:#0b0b0f) — established in globals.css by ADMIN-CONSOLE. Pages shrink it via inline overrides but keep the class.
Table of contents
- 0. Use this spec
- 1. What this builds (full surface map)
- 2. Design system — the replication core (copy verbatim)
- 3. Admin auth guard (every /api/admin/email/ route)
- 4. Page — Campaigns list (email/page.tsx)
- 5. Page — Campaign editor (email/[id]/page.tsx)
- 6. Page — Templates (email/templates/page.tsx)
- 7. Page — Layout (email/layout/page.tsx)
- 8. Page — Enrollments (email/enrollments/page.tsx)
- 9. Page — Analytics (email/analytics/page.tsx)
- 10. The 14 admin API routes (reference)
- 11. The engine layer
- 12. Schema additions beyond EMAIL-INFRASTRUCTURE
- 13. Seed campaigns
- 14. Invariants to preserve (do not regress)
- 15. Build sequence (slices — pause after each for review)
- 16. Kickoff prompt
- 17. Reference files in BKE
How to run it
Drop EMAIL-AUTOMATION-CONSOLE-PLAYBOOK.md into your repo, then tell Claude Code: “Read EMAIL-AUTOMATION-CONSOLE-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.
More admin & ops playbooks
Admin Console
A 12-section operator cockpit: accounts, impersonation, P&L, audit log, settings.
Read + download →A-tierAdmin Analytics Dashboard
The visualization half — KPI tiles, funnels, channel breakdown, per-page drill-down.
Read + download →A-tierSupport Inbox
In-app ticketing and a shared inbox — no third-party helpdesk.
Read + download →