whisper-money/database/factories
Víctor Falcón ce6bfc9c56
feat(drip): email users stuck on the paywall a day after onboarding (#562)
## What

Sends an automated follow-up email the day after a user finishes
onboarding but stays stuck on the paywall, asking why they didn't
continue and inviting a direct reply.

## Why

Users who connect a bank account during onboarding but never pick a plan
are permanently redirected to the paywall by `EnsureUserIsSubscribed` —
they finish onboarding and then can't access the app. This reaches out
to understand the friction and recover them.

## Who gets the email (the genuinely stuck cohort)

- `onboarded_at` is calendar-yesterday (`whereDate('onboarded_at',
today()->subDay())`)
- Has an active banking connection (`bankingConnections()->exists()`)
- No Pro plan (`hasProPlan()` is false)
- Hasn't already received this email (idempotent via `UserMailLog`)

Users **without** a bank connection are excluded: they fall through to
free access after seeing the paywall once, so they aren't stuck.

## How

- New `email:paywall-follow-up` command scans the cohort daily and
queues the job — scheduled `dailyAt('10:00')` Europe/Madrid in
`routes/console.php`.
- New `DripEmailType::PaywallFollowUp` (`paywall_follow_up`) +
idempotent send job following the existing drip pattern.
- Short, human Markdown email with an explicit `replyTo`
(`hi@whisper.money`) so replies reach a real inbox.
- Spanish copy added to `lang/es.json`.

## Tests

10 new tests (correct cohort matched; wrong day / no bank / Pro plan
excluded; no double-send; no-op when drip disabled). `pint` clean.

## Note

There was no existing user-scanning drip command (current drips dispatch
with `delay()` on `Registered`). Since "stuck on paywall" state isn't
known at registration time, a daily scanning command is the right fit.
2026-06-19 14:11:12 +00:00
..
AccountBalanceFactory.php chore: upgrade Laravel 12 to 13 (#242) 2026-03-25 12:56:33 +00:00
AccountFactory.php feat(accounts): add loan amortization projections for loan accounts (#246) 2026-03-26 15:06:09 +01:00
AiConsentFactory.php feat(ai): suggest automation rules during onboarding (#523) 2026-06-13 22:51:15 +02:00
AutomationRuleFactory.php feat(ai): auto-categorize transactions with AI (behind flag) (#535) 2026-06-15 16:35:20 +02:00
BankFactory.php chore: upgrade Laravel 12 to 13 (#242) 2026-03-25 12:56:33 +00:00
BankingConnectionFactory.php refactor: centralize duplicated provider & locale keys into enums (#543) 2026-06-16 13:43:14 +00:00
BudgetFactory.php feat: add catch-all budgets (#527) 2026-06-15 16:07:19 +00:00
BudgetPeriodFactory.php chore: upgrade Laravel 12 to 13 (#242) 2026-03-25 12:56:33 +00:00
BudgetTransactionFactory.php chore: upgrade Laravel 12 to 13 (#242) 2026-03-25 12:56:33 +00:00
CategoryCorrectionFactory.php feat(ai): auto-categorize transactions with AI (behind flag) (#535) 2026-06-15 16:35:20 +02:00
CategoryFactory.php feat: parent/child category tree (#474) 2026-06-03 19:30:12 +02:00
ExchangeRateFactory.php chore: upgrade Laravel 12 to 13 (#242) 2026-03-25 12:56:33 +00:00
IntegrationRequestFactory.php feat(integration-requests): markdown comments and in-progress status (#553) 2026-06-18 08:36:43 +00:00
IntegrationRequestVoteFactory.php feat(integration-requests): community board to request & vote bank integrations (#550) 2026-06-17 12:50:51 +00:00
LabelFactory.php chore: upgrade Laravel 12 to 13 (#242) 2026-03-25 12:56:33 +00:00
LoanDetailFactory.php feat(accounts): add loan amortization projections for loan accounts (#246) 2026-03-26 15:06:09 +01:00
RealEstateDetailFactory.php feat(accounts): add market value and annual revaluation to real estate accounts (#245) 2026-03-26 11:02:20 +01:00
RuleSuggestionFactory.php feat(ai): suggest automation rules during onboarding (#523) 2026-06-13 22:51:15 +02:00
SavedFilterFactory.php feat(transactions): save and reuse transaction filters (#496) 2026-06-05 18:00:14 +02:00
SuggestionRunFactory.php feat(ai): suggest automation rules during onboarding (#523) 2026-06-13 22:51:15 +02:00
TransactionFactory.php chore: upgrade Laravel 12 to 13 (#242) 2026-03-25 12:56:33 +00:00
UserFactory.php chore: upgrade Laravel 12 to 13 (#242) 2026-03-25 12:56:33 +00:00
UserLeadFactory.php feat(leads): cohort-based launch invitations with per-user Stripe coupons (#333) 2026-04-30 15:10:28 +01:00
UserMailLogFactory.php feat(drip): email users stuck on the paywall a day after onboarding (#562) 2026-06-19 14:11:12 +00:00
UserSettingFactory.php feat(settings): let users disable bank transactions email (#472) 2026-06-02 12:24:39 +02:00