whisper-money/app/Mail
Víctor Falcón eea929ef9d refactor(drip): extract base mailable and job for the drip email family
The eight drip emails and their eight send jobs were near copy-paste. Every
mailable repeated the same constructor, $tries/$backoff, drip_from envelope,
markdown+userName content and RateLimited middleware, differing only in subject
and template (plus a reply-to on one and an extra view var on another). Every job
repeated the canReceiveEmails/hasReceivedEmail guards, the Mail::send call and the
UserMailLog::create block, differing only in the email type, the mailable, and a
handful of per-email eligibility checks.

Introduce two abstract bases:

- DripMail owns the shared mailable shape; subclasses declare dripSubject() and
  template(), with optional contentData() (PromoCode's promo code) and
  repliesToSender() (PaywallFollowUp) hooks.
- SendDripEmailJob owns the shared handle() flow; subclasses declare emailType()
  and buildMail(), with an optional shouldSend() hook for the per-email
  eligibility rules (pro-plan, onboarding, transactions, AI consent, ...).

Each mailable drops from ~68 to ~13 lines and each job from ~48 to ~18, with the
shared send/log logic now living in one place.

Behavior unchanged: subjects, from/reply-to, queue, rate limiting, templates,
view data and every eligibility guard are preserved. Full suite green
(1868 passing, 0 failing) and drip job/command/listener tests pass (71/71).
2026-07-04 20:28:20 +02:00
..
Drip refactor(drip): extract base mailable and job for the drip email family 2026-07-04 20:28:20 +02:00
BankTransactionsSyncedEmail.php fix: make transaction sync email use default sender (#265) 2026-04-07 13:50:42 +01:00
BankingConnectionAuthFailedEmail.php fix: split drip and default email senders (#263) 2026-04-06 12:16:47 +02:00
BankingConnectionExpiredEmail.php Notify users about expired bank connections (#404) 2026-05-20 09:20:13 +02:00
BrokenBankLogosReportEmail.php fix: split drip and default email senders (#263) 2026-04-06 12:16:47 +02:00
EnableBankingConnectionsCancelledEmail.php Cancel Enable Banking connections for free users (#289) 2026-04-15 16:23:03 +02:00
UpdateEmail.php fix: split drip and default email senders (#263) 2026-04-06 12:16:47 +02:00
UserLeadInvitation.php feat(leads): cohort-based launch invitations with per-user Stripe coupons (#333) 2026-04-30 15:10:28 +01:00
UserLeadReInvitation.php feat(leads): add user lead re-invite campaign (#432) 2026-05-26 08:35:31 +02:00
WaitlistOvertaken.php feat: selective retry of failed lead email jobs (#286) 2026-04-15 08:00:29 +01:00
WaitlistReferralNotification.php feat: selective retry of failed lead email jobs (#286) 2026-04-15 08:00:29 +01:00
WaitlistWelcome.php feat: selective retry of failed lead email jobs (#286) 2026-04-15 08:00:29 +01:00