Claude Templates / A-tier · High leverage
Admin & Ops
The Support Inbox Playbook
In-app ticketing and a shared inbox — no third-party helpdesk.
SUPPORT-INBOX-PLAYBOOK.md · 9 sections · 4,911 words · 41 KB · markdown
A full support desk inside your own admin console. Inbound email webhook to ticket threading with global ticket numbers, a conversation spine that also carries internal notes and personal mailboxes, threaded outbound replies, unread tracking, realtime toasts, full-text search, and answer suggestions from resolved tickets.
What's inside
- //Inbound email webhook → ticket threading with a 3-tier match + auto-reopen
- //The conversation spine: mailboxes, messages, events, attachments
- //Per-mailbox row-level security
- //Threaded outbound replies that stay in the customer's thread
- //Unread tracking, realtime toasts, a nav badge
- //Full-text search + "similar resolved ticket" answer suggestions
- //Internal notes and assignment
When to use it
Weeks 3-4, after email infrastructure and the admin shell.
Build these first
Straight from the file
The system is one conversation spine reused by three parent types. Support tickets are the primary one; the same mailboxes + conversation_messages + conversation_events + conversation_attachments tables also back leads (sales pipeline) and mail_threads (free-form personal team email). This playbook documents the support-ticket path end to end and notes where the spine is shared, so you can ship tickets alone and add leads/personal-mail later without re-architecting.
Table of contents
- 0. Architecture in one breath
- 1. Database schema (the canonical DDL)
- 2. Email helper libraries (src/lib/email/)
- 3. Inbound webhook — POST /api/email/inbound (runtime='nodejs')
- 4. Operator-facing API + UI
- 5. Env vars + external setup
- 6. Adaptation checklist (per new app)
- 7. Build order (slices — pause after each per planning rules)
- 8. Hard-won rules (bake these in — they are non-obvious)
How to run it
Drop SUPPORT-INBOX-PLAYBOOK.md into your repo, then tell Claude Code: “Read SUPPORT-INBOX-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-tierEmail Automation Console
The operator half of email — campaigns, templates, enrollments, analytics.
Read + download →