Modify log_upcoming_renewal_notification_job to create corresponding EmailEvent records
Problem
Currently, the LogUpcomingRenewalNotificationJob only logs information about upcoming subscription renewal email notifications from Zuora. It doesn't create structured records of these notifications in our system. With our new Notifications::EmailEvent model, we need to enhance this job to create proper EmailEvent records for better tracking and analysis.
Proposal
Modify the LogUpcomingRenewalNotificationJob to create Notifications::EmailEvent records when Zuora sends renewal notification emails. This will involve:
- Updating the
performmethod to create an EmailEvent record after logging the notification - Determining the appropriate source object (likely the Subscription or Order) to associate with the EmailEvent
- Extracting the recipient email from the Zuora callback attributes
- Adding monitoring to ensure EmailEvent records are being created correctly
The job will continue to log the information as it currently does, but will also create structured records in our EmailEvent table.
Result
- Comprehensive tracking of all Zuora-sent renewal notifications in the
EmailEventtable - Improved debugging capabilities for notification issues
How will we measure success?
- EmailEvent records are created for every Zuora notification received
- The records contain accurate information about the notification
- We can query the
EmailEventtable to understand notification patterns
Edited by Minahil Nichols