whisper-money/tests/Feature
Víctor Falcón 73bb25ae8f
feat: Implement drip email campaign system (#35)
## Summary

- Implement event-driven drip email campaign system for new user signups
- Add 5 targeted emails based on user journey (welcome, onboarding
reminder, promo code, import help, feedback)
- Configure Laravel Horizon with Redis queue for reliable job processing
- Track sent emails in `user_mail_logs` table to prevent duplicates

## Email Schedule

| Email | Timing | Condition |
|-------|--------|-----------|
| Welcome | 30 min after signup | All users |
| Onboarding Reminder | 1 day after signup | Not onboarded |
| Promo Code (FOUNDER) | 1 day after signup | Onboarded + has
transactions + not subscribed |
| Import Help | 1 day after signup | Onboarded + no transactions + not
subscribed |
| Feedback | 5 days after signup | Not subscribed |

## Architecture

```
User Registers → ScheduleDripEmailsListener
    ├─> SendWelcomeEmailJob (30 min delay)
    ├─> SendOnboardingReminderEmailJob (1 day delay)
    ├─> SendPromoCodeEmailJob (1 day delay)
    ├─> SendImportHelpEmailJob (1 day delay)
    └─> SendFeedbackEmailJob (5 days delay)
```

Each job checks conditions at execution time and either sends the email
+ logs it, or silently completes.

## Test plan

- [x] All 23 drip email tests pass
- [x] Migration creates `user_mail_logs` table
- [x] Jobs dispatch with correct delays
- [x] Emails only sent when conditions are met
- [x] Duplicate emails prevented via UserMailLog check
- [ ] Verify Horizon processes jobs in production
2025-12-17 08:34:17 +01:00
..
Auth User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
Console Fix improve testing 2025-11-26 11:52:01 +01:00
Jobs/Drip feat: Implement drip email campaign system (#35) 2025-12-17 08:34:17 +01:00
Listeners feat: Implement drip email campaign system (#35) 2025-12-17 08:34:17 +01:00
Onboarding User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
Settings Accounts: Allow users to create custom banks with his own logo, and name (#12) 2025-12-04 15:24:04 +01:00
Sync feat: add transaction labels feature (#24) 2025-12-13 13:02:19 +01:00
AccountBalanceControllerTest.php Accounts: new pages to list, and see account details (#13) 2025-12-05 14:33:18 +01:00
AccountBalanceSyncControllerTest.php feat(AccountBalanceSync): Update existing balances and add new ones efficiently 2025-12-01 11:04:50 +01:00
AccountControllerTest.php User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
AutomationRuleTest.php Update automated rule timestamp when adding/removing a category or label 2025-12-15 14:30:35 +01:00
BulkUpdateTransactionsTest.php Bulk actions/select all (#33) 2025-12-15 17:59:58 +01:00
DashboardAnalyticsTest.php Add bank relation to account model and update related components 2025-12-04 16:24:12 +01:00
DashboardTest.php User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
EncryptionTest.php User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
ExampleTest.php Install Pest 2025-11-07 12:01:58 +00:00
InertiaSharedDataTest.php SEO landing page 2025-11-25 11:33:11 +01:00
LabelTest.php feat: add transaction labels feature (#24) 2025-12-13 13:02:19 +01:00
SitemapTest.php User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
SubscriptionTest.php User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
TransactionTest.php User Onboarding Flow (#23) 2025-12-12 13:06:08 +01:00
UserLeadTest.php Add User Lead functionality and tests 2025-11-25 10:31:25 +01:00