feat(email): abandoned checkout email, 80% free tier warning, credits exhausted email#3908
feat(email): abandoned checkout email, 80% free tier warning, credits exhausted email#3908waleedlatif1 merged 13 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Adjusts free-tier upgrade nudges to trigger at 80% (and updates subject/footer copy), while restricting the existing 80% budget warning email to paid users only. Also centralizes “plain email” styling and Pro feature constants, updates Written by Cursor Bugbot for commit 034b0f9. Configure here. |
Greptile SummaryThis PR adds three email touchpoints for billing lifecycle events: an abandoned checkout recovery email (personal tone, from the founder), a lowered free-tier 80% usage warning (down from 90%), and a new credits-exhausted email when free users hit 100%. Key changes:
Confidence Score: 5/5Safe to merge — previous P0/P1 concerns have been fully addressed and no new issues were found. All three prior review threads (subscription-mode filter, existing-subscriber guard, preview-text duplication) are resolved in this commit. The threshold logic in usage.ts is correctly structured: the three email paths (paid 80%, free 80%, free 100%) are mutually exclusive by construction, and the early-return guards cannot interfere with one another. No security, data-loss, or correctness issues remain. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Stripe Webhook] --> B{Event Type}
B -->|checkout.session.expired| C{session.mode === subscription?}
C -->|No| D[Skip — payment/setup session]
C -->|Yes| E{User found by stripeCustomerId?}
E -->|No| F[Log warn & return]
E -->|Yes| G{isProPlan?}
G -->|Yes| H[Skip — already subscribed]
G -->|No| I[Send AbandonedCheckoutEmail\nfrom Emir, emailType: notifications]
B -->|Usage update| J[maybeSendUsageThresholdEmail]
J --> K{isFreeUser?}
K -->|No — Paid user| L{crosses80%?}
L -->|Yes| M[Send UsageThresholdEmail\nbudget warning]
L -->|No| N[No email]
K -->|Yes — Free user| O{crosses100%?}
O -->|Yes| P[Send CreditsExhaustedEmail\nworkflows paused]
O -->|No| Q{crosses80%?}
Q -->|Yes| R[Send FreeTierUpgradeEmail\nupgrade nudge at 80%]
Q -->|No| S[No email]
style I fill:#e8f5e9
style P fill:#ffebee
style R fill:#fff3e0
style M fill:#e3f2fd
Reviews (5): Last reviewed commit: "fix(email): use isProPlan to catch org-l..." | Re-trigger Greptile |
…s constant, fix double email on 100% usage
…d users, fix preview text
|
@greptile |
|
@cursor review |
… unsubscribe preferences
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
…ed checkout guard
|
@greptile |
|
@cursor review |
Summary
Type of Change
Testing
Tested manually
Checklist