Description
Add support for bundling emails end email settings.
Notifications settings endpoints should be updated to save preferences for emails (same as what we are doing for web preferences now). Additionally, there should be a bundle setting for emails with options: no bundling, 10 minutes, 1 hour, 24 hours, weekly (these should be configurable levels).
When a notification is created, email should not be sent right away, but we should first check email settings and send it immediately if email bundling is off. Otherwise, the email for that notification will be sent later.
All bundle intervals should be handled via scheduled jobs. At each interval check for new notifications that require emails to be sent and send bundle email containing all notifications created since last sending the email.
@vikasrohit should we create a new email event in kafka and new template in sendgrid for this one?