fix(payments-next): Add free trial reactivation email variant#20423
fix(payments-next): Add free trial reactivation email variant#20423david1alvarez merged 1 commit intomainfrom
Conversation
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.
xlisachan
left a comment
There was a problem hiding this comment.
Email Subject Line
The email subject line for Free Trials will still appear as Your <%- productName %> subscription has been reactivated
libs/accounts/email-renderer/src/templates/subscriptionReactivation/index.tspackages/fxa-auth-server/lib/senders/emails/templates/subscriptionReactivation/includes.json
Should the email subject line for Free Trials be Your <%- productName %> trial has been reactivated instead?
See examples:
libs/accounts/email-renderer/src/templates/lowRecoveryCodes/index.tspackages/fxa-auth-server/lib/senders/emails/templates/lowRecoveryCodes/includes.ts
Tests
- In stripe.spec.ts, can we add a test with a mock subscription with
subscription.status === 'trialing'to expectsisFreeTrialReactivation: true?
xlisachan
left a comment
There was a problem hiding this comment.
r+wc (see comments), thanks Davey!
| message: 'Your <%- productName %> trial has been reactivated', | ||
| } | ||
| : { | ||
| id: 'subscriptionReactivation-subject-2', |
There was a problem hiding this comment.
Acknowledging that subscriptionReactivation-subject-2 was previously used; however, it does not exist in the ftl file.
Can you correct the ftl file by removing subscriptionReactivation-subject = { $productName } subscription reactivated and adding subscriptionReactivation-subject-2 with the string below? Thanks!
| id: 'subscriptionReactivation-subject', | ||
| message: '<%- productName %> subscription reactivated', |
There was a problem hiding this comment.
This should also be updated to match what's used in email-renderer as well.
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
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)
