Skip to content

fix(payments-next): Add free trial reactivation email variant#20423

Open
david1alvarez wants to merge 1 commit intomainfrom
PAY-3656
Open

fix(payments-next): Add free trial reactivation email variant#20423
david1alvarez wants to merge 1 commit intomainfrom
PAY-3656

Conversation

@david1alvarez
Copy link
Copy Markdown
Contributor

@david1alvarez david1alvarez commented Apr 21, 2026

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

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).
  • I have manually reviewed all AI generated code.

How to review (Optional)

  • Key files/areas to focus on:
  • Suggested review order:
  • Risky or complex parts:

Screenshots (Optional)

(free trial variant)
Screenshot 2026-04-21 at 1 48 02 PM

(subscription variant, current/unchanged)
Screenshot 2026-04-21 at 1 47 56 PM

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
@david1alvarez david1alvarez requested a review from a team as a code owner April 21, 2026 20:55
Copilot AI review requested due to automatic review settings April 21, 2026 20:55
@david1alvarez david1alvarez requested a review from a team as a code owner April 21, 2026 20:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 isFreeTrialReactivation and uses it to conditionally select a “trial reactivated” title in the subscriptionReactivation templates (MJML + plaintext) with new FTL string.
  • Threads isFreeTrialReactivation from 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.

Comment on lines 3382 to 3384
: null,
isFreeTrialReactivation: subscription.status === 'trialing',
planConfig,
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants