Skip to main content

Email & Outreach Flows

Why this folder exists​

On 2026-04-13, a pastor received a lifecycle email with a "Manage My Subscription" CTA that silently redirected him to the ChurchWiseAI homepage instead of his dashboard. The bug had been in production for weeks. Every QA pass ("go-live ready") had missed it. The test suite clicked buttons in the UI; it never read an email and followed a link.

This folder fixes that failure mode by requiring every email flow to be:

  1. Documented end-to-end — trigger through destination, with exact file paths, DB columns, and expected content.
  2. Verifiable at every step — each step names the check that proves it works, using the shared vocabulary in _verification-vocab.md.
  3. Compliance-annotated — CASL / CAN-SPAM clauses called out at the step that enforces them.

If a flow file says "Step 5: Gmail delivers the email" without a delivered: verification entry, the flow is not complete. Incomplete flows must not be declared launch-ready.

How to read a flow file​

Every flow file uses _template.md. The critical sections:

SectionWhat it answers
TriggerWhat causes the email to fire?
PreconditionsWhat state must exist before trigger fires?
StepsWhat happens, in order, with code/DB references
VerificationsFor each step, the exact check that proves it works
Failure modesKnown ways this breaks + the alert that catches it
Unsubscribe / DNCWhich email_do_not_contact or opt-out flag gates this flow

Running the verifications​

Each flow's verifications map to tests / commands / MCP calls. See _verification-vocab.md for the exact tool each verb invokes.

The QA orchestrator surfaces flows via /qa email-flows (planned). Individual flow verification: /qa flow:<flow-id>.

Current flow inventory​

Priority order is set by the founder. Cold outreach (PewSearch Pro Website, active this week) is #1. Then customer lifecycle, then marketing, then ops.

Cold outreach (priority 1)​

FlowStatusFile
No-website → Pro Website pitch (2026-04 campaign)DRAFTEDcold-outreach-no-website-pro-website.md
Unsubscribe & global DNC gating (cross-cutting)DRAFTEDunsubscribe-and-dnc-gating.md
Reply triage (auto-responder + founder routing)TODO—
Bounce handlingTODO—
Kill-switch (3% unsub rolling 24h)TODO—

Customer lifecycle (priority 2)​

FlowStatusFile
Signup → Welcome (Stripe webhook)TODO—
Day 2 / 5 / 7 onboarding (cron)TODO—
Trial-ending (Stripe trial_will_end + day-13 cron)TODO—
Payment failedTODO—
Cancellation scheduledTODO—
Phone number provisionedTODO—
Team member inviteTODO—
Day-30 checkinTODO—
WinbackTODO—

Marketing (priority 3)​

FlowStatusFile
Newsletter welcome + 3-day sequenceTODO—
AI Ministry Course (7-day)TODO—
AI Starter Kit nurture (3 emails)TODO—
Cross-promo between propertiesTODO—

Ops (priority 4)​

FlowStatusFile
Founder action SMS + emailTODO—
Voice setup alertTODO—
New sale notification (internal)TODO—
Payment received (internal)TODO—

Conventions​

  • File names: kebab-case, describe the flow's purpose, not its trigger. cold-outreach-no-website-pro-website.md not pewsearch-campaign-apr.md.
  • Underscored files (_template.md, _verification-vocab.md) are meta — reference material, not flows.
  • Status markers: DRAFTED (written, awaiting verification pass), VERIFIED (every step's check passes against prod), STALE (code has moved; doc needs update). Only VERIFIED flows count toward "launch-ready."
  • Don't duplicate the code. Link to route.ts / table columns by path. The flow file is the story, the code is the truth.