Skip to content

feat(payments-next): Update email reminder logic#20005

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

feat(payments-next): Update email reminder logic#20005
david1alvarez wants to merge 1 commit intomainfrom
PAY-2291

Conversation

@david1alvarez
Copy link
Contributor

Because:

  • We need to send emails at 15 days prior to billing for annual plans
  • We need to send emails at 7 days prior to billing for monthly plans that have an ending discount and are returning to full price

This commit:

  • Updates the logic to check whether a customer has an persisting discount for a monthly plan, and does not send email reminders for those plans
  • Renames the hadDiscount variable to discountEnding to better reflect its purpose

Closes #PAY-2291 (to follow after merge of PR in webservices-infra)

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).

Because:

* We need to send emails at 15 days prior to billing for annual plans
* We need to send emails at 7 days prior to billing for monthly plans that have an ending discount and are returning to full price

This commit:

* Updates the logic to check whether a customer has an persisting discount for a monthly plan, and does not send email reminders for those plans
* Renames the `hadDiscount` variable to `discountEnding` to better reflect its purpose

Closes #PAY-2291 (to follow after merge of PR in webservices-infra)
@david1alvarez david1alvarez requested a review from a team as a code owner February 5, 2026 20:02
Copy link
Contributor

@StaberindeZA StaberindeZA left a comment

Choose a reason for hiding this comment

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

r+ lgtm

Just the one nit that's optional.

Just a question regarding this note from the ticket...

NOTE: Take note of the current settings for Staging, as we typically send these emails sooner in Staging for testing purposes, and ensure they are set correctly for Daily test plans.

... is this PR meant to add functionality for the daily plan so it can be tested in Stage?

// Business rule: Monthly subscriptions only receive renewal reminders when a discount is ending,
// to avoid notification fatigue for standard monthly renewals.
if (interval === 'month' && !discountEnding) {
this.log.info('subscription-reminders.skipping-monthly-no-discount', {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit(non-blocking): update message type to match existing patterns

Typically the message type matches the method/function it's called from with some additional identifiers. This way it's easy to know just from looking at the message type where this log statement was called from.

Suggestion: subscription-reminders.skipping-monthly-no-discount => sendSubscriptionRenewalReminderEmail.skippingMonthlyNoDiscount

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.

2 participants