Stu Mason
Stu Mason

Activity

StuMason/cleanconnect
Client SaaS
TypeScript
Pull Request Opened

PR #197 opened: feat: welcome drip-sequence engine (PR7)

Automated welcome series for new users over their first ~2 weeks. Engine is complete; copy is draft — the words live in blade views so Adele/Keith can tweak them without touching code.

How it works

  • Two tracks — client + cleaner, 4 steps each (day 0 / 2 / 5 / 10), defined in App\Drip\DripSequences (key, after_days, subject, view).
  • drip_email_sends ledger (unique user + sequence + step) — the idempotent send log; a step can only ever send once per user.
  • drip:send command, scheduled daily at 10:00. --dry-run lists recipients without sending.
  • Generic DripSequenceMailThrottlesResendApi (under Resends rate cap) + the shared one-click-unsubscribe footer. Renders verified in-browser.
  • Respects marketing_opt_in at send time (opt-outs skipped).

The safety bit — no back-fill blast

A 3-day due window means a step only sends when its offset became due recently. This:

  • paces new users (one step at a time), and
  • crucially, stops the command emailing the whole sequence to users who registered long before the drip existed — theyre past every window, so they get nothing.

Copy

Draft copy is in resources/views/mail/drip/{client,cleaner}/*.blade.php, mirroring scratch/comms-copy-for-signoff.md. Easy to edit per-step. Sign-off pending.

Tests (8)

day-0 + day-2 sends, idempotency, opt-out skipped, no back-fill of old users, cleaner-vs-client routing, dry-run sends/records nothing, mailable renders with unsubscribe.

Note

The drip:send schedule is live on deploy, but the due-window guard means nothing goes out to existing users — only genuinely new signups enter. Hold/disable the schedule if youd rather wait for copy sign-off first; say the word.

+507
additions
-0
deletions
17
files changed