whisper-money/resources/views/mail
Víctor Falcón 934d834ab3
feat(email): follow up after post-onboarding AI consent (#596)
## What

Adds a lifecycle email sent **2 days after a user records AI consent**,
but only when that consent was given **outside of onboarding** — i.e.
more than 3 days after sign-up. This targets users who deliberately
opted into AI later (e.g. via the billing toggle / transactions banner
gated by the `AiConsentSettings` flag), not those who consented during
initial setup.

## How

- **`email:ai-consent-follow-up`** scheduled command (daily, 10:15
Europe/Madrid) selects active consents accepted exactly 2 days ago,
skips onboarding-era ones (`accepted_at <= created_at + 3 days`), and
queues a job per user.
- **`SendAiConsentFollowUpEmailJob`** sends the mailable and records a
`UserMailLog`. Dedup, locale and the queued-email plumbing all reuse the
existing drip system — **no migration**.
- Email is localised automatically via the user's `HasLocalePreference`,
like every other drip email.

## Design notes

- **Scheduled command, not a 2-day delayed job** — survives worker
restarts and respects consent revoked in the meantime.
- **Exact "2 days ago" window**, matching the existing paywall drip. If
the scheduler misses a day that cohort isn't retried; kept consistent
with the other drips on purpose.
- Copy is a first draft — open to wording tweaks.

## Tests

`tests/Feature/SendAiConsentFollowUpEmailsCommandTest.php` — 9 tests
covering the happy path, onboarding exclusion (incl. the exact-3-days
boundary), timing window, revoked consent, the disabled-drip gate,
single-send + mail log, no-resend, and locale rendering. All green, Pint
clean.
2026-06-26 17:56:06 +00:00
..
drip feat(email): follow up after post-onboarding AI consent (#596) 2026-06-26 17:56:06 +00:00
invitations feat(leads): cohort-based launch invitations with per-user Stripe coupons (#333) 2026-04-30 15:10:28 +01:00
updates chore: update Discord invite link (#452) 2026-05-29 15:56:48 +02:00
bank-transactions-synced.blade.php feat(settings): let users disable bank transactions email (#472) 2026-06-02 12:24:39 +02:00
banking-connection-auth-failed.blade.php fix: reorder signed names in mail templates (#266) 2026-04-10 13:32:32 +01:00
banking-connection-expired.blade.php Notify users about expired bank connections (#404) 2026-05-20 09:20:13 +02:00
broken-bank-logos-report.blade.php Add weekly bank logo audit command (#211) 2026-03-06 11:05:13 +00:00
enable-banking-connections-cancelled.blade.php Cancel Enable Banking connections for free users (#289) 2026-04-15 16:23:03 +02:00
user-lead-invitation.blade.php fix: reorder signed names in mail templates (#266) 2026-04-10 13:32:32 +01:00
user-lead-re-invitation.blade.php feat(leads): add user lead re-invite campaign (#432) 2026-05-26 08:35:31 +02:00
verify-email.blade.php fix: reorder signed names in mail templates (#266) 2026-04-10 13:32:32 +01:00
verify-user-lead-email.blade.php feat: verify waitlist leads (#285) 2026-04-14 11:26:01 +01:00
waitlist-overtaken.blade.php fix: reorder signed names in mail templates (#266) 2026-04-10 13:32:32 +01:00
waitlist-referral-notification.blade.php fix: reorder signed names in mail templates (#266) 2026-04-10 13:32:32 +01:00
waitlist-welcome.blade.php fix: reorder signed names in mail templates (#266) 2026-04-10 13:32:32 +01:00