feat(payments-next): Update email reminder logic#20005
feat(payments-next): Update email reminder logic#20005david1alvarez wants to merge 1 commit intomainfrom
Conversation
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)
StaberindeZA
left a comment
There was a problem hiding this comment.
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', { |
There was a problem hiding this comment.
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
Because:
This commit:
hadDiscountvariable todiscountEndingto better reflect its purposeCloses #PAY-2291 (to follow after merge of PR in webservices-infra)
Checklist
Put an
xin the boxes that apply