fix(payments-next): Add free trial reactivation email variant#20423
fix(payments-next): Add free trial reactivation email variant#20423david1alvarez wants to merge 1 commit intomainfrom
Conversation
Because: * Upon reactivating a free trial after cancelling it, the user receives an email. This email contains language centered around full subscriptions This commit: * Updates the emails to include a conditional, changing the banner to reference renewing the users trial when a free trial is being renewed Closes #PAY-3656
There was a problem hiding this comment.
Pull request overview
Adds a free-trial-specific title variant for the “subscription reactivation” transactional email so users reactivating during an active free trial don’t see subscription-centric banner language.
Changes:
- Introduces
isFreeTrialReactivationand uses it to conditionally select a “trial reactivated” title in the subscriptionReactivation templates (MJML + plaintext) with new FTL string. - Threads
isFreeTrialReactivationfrom Stripe subscription status → auth-server mailer template values. - Bumps template version(s) and updates Storybook stories; adjusts Stripe reactivation-details test expectations.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/fxa-auth-server/lib/senders/emails/templates/subscriptionReactivation/index.txt | Conditional plaintext title key for free-trial vs subscription reactivation. |
| packages/fxa-auth-server/lib/senders/emails/templates/subscriptionReactivation/index.mjml | Conditional banner/title rendering based on isFreeTrialReactivation. |
| packages/fxa-auth-server/lib/senders/emails/templates/subscriptionReactivation/en.ftl | Adds subscriptionReactivation-freeTrial-title localization string. |
| packages/fxa-auth-server/lib/senders/emails/templates/subscriptionReactivation/index.stories.ts | Adds Storybook story variant exercising the free-trial title. |
| packages/fxa-auth-server/lib/senders/emails/templates/_versions.json | Bumps subscriptionReactivation template version to 3. |
| packages/fxa-auth-server/lib/senders/email.js | Passes isFreeTrialReactivation into template values (default false). |
| packages/fxa-auth-server/lib/payments/stripe.ts | Sets isFreeTrialReactivation based on Stripe subscription status. |
| packages/fxa-auth-server/lib/payments/stripe.spec.ts | Updates expected reactivation-details payload to include isFreeTrialReactivation. |
| libs/accounts/email-renderer/src/templates/subscriptionReactivation/index.txt | Mirrors conditional plaintext title key for free-trial vs subscription reactivation. |
| libs/accounts/email-renderer/src/templates/subscriptionReactivation/index.mjml | Mirrors conditional banner/title rendering based on isFreeTrialReactivation. |
| libs/accounts/email-renderer/src/templates/subscriptionReactivation/en.ftl | Mirrors new free-trial title localization string. |
| libs/accounts/email-renderer/src/templates/subscriptionReactivation/index.stories.ts | Adds renderer Storybook variant for free-trial reactivation. |
| libs/accounts/email-renderer/src/templates/subscriptionReactivation/index.ts | Adds isFreeTrialReactivation to template data and bumps template version to 3. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| : null, | ||
| isFreeTrialReactivation: subscription.status === 'trialing', | ||
| planConfig, |
There was a problem hiding this comment.
isFreeTrialReactivation is derived from subscription.status === 'trialing', but the existing tests for extractSubscriptionUpdateReactivationDetailsForEmail only cover the active status (and now assert false). Please add a test case that sets the fixture subscription status to trialing (or uses a trialing fixture) and asserts isFreeTrialReactivation: true to prevent regressions in the free-trial email variant path.
Because:
This commit:
Closes #PAY-3656
Checklist
Put an
xin the boxes that applyHow to review (Optional)
Screenshots (Optional)
(free trial variant)

(subscription variant, current/unchanged)
