Update UpcomingNotificationCronJob to handle multiple periods, i.e. 90/60/45/30/1 day cadence
Problem
Currently, the UpcomingNotificationCronJob only sends renewal notifications at a single fixed period (15 days) before subscription renewal. This limited approach doesn't provide customers with sufficient notice about upcoming renewals at different stages of their subscription lifecycle. We need to enhance this job to support multiple notification periods (90, 60, 45, 30, 15, and 1 day before renewal) to improve customer communication and reduce renewal surprises.
Proposal
Modify the UpcomingNotificationCronJob to support multiple notification periods by:
- Replacing the single
NOTIFICATION_PERIODconstant with a configuration for multiple periods (90, 60, 45, 30, 15, and 1 day) - Updating the
performmethod to iterate through each period and find applicable orders for each specific timeframe - Modifying the order selection logic to consider precise date ranges for each period
- Implementing this behind a feature flag to allow for controlled rollout
Result
- Customers will receive notifications at multiple points before their subscription renewal
Next steps (if any)
- Update the
SendUpcomingNotificationServiceto handle the different notification types - Create appropriate default renewal email template
Edited by Minahil Nichols