Issue #3362297 New Queue Worker to send Email Notifications
Changes:
- New queue
recurring_events_registration_email_notifications_queue_workerto send Email Notifications. Queue Worker Class:modules/recurring_events_registration/src/Plugin/QueueWorker/EmailNotificationsQueueWorker.php - Actions that trigger emails to multiple recipients (registrants) were modified to add items to the queue instead of using
recurring_events_registration_send_notification(). Namely, the notifications corresponding to these keys:registration_reminder,series_modification_notification,instance_modification_notification,instance_deletion_notification,series_deletion_notification - Items can be added to the queue using the new helper function
addEmailNotificationToQueue($key, RegistrantInterface $registrant)in therecurring_events_registration.notification_serviceservice - The new function
addEmailNotificationToQueue($key, RegistrantInterface $registrant)also invokeshook_recurring_events_registration_send_notification_alterto let modules determine whether a notification will be added to the queue based on properties of the Registrant - Actions that trigger just one email notification to one recipient (registrant) continue using
recurring_events_registration_send_notification(). Namely:promotion_notification,registration_notification,waitlist_notification
Pending:
- Maybe provide a UI to configure if the system should use Queue Worker or not. People could have a checkbox to decide whether emails for notification types that are sent to multiple recipients should use the queue or send immediately.