Problem/Motivation
Emails are sent twice through content_moderation_notifications. I have a notification sent when a "New Invoice" is created.
It is sent TO: the site email and gets BCC: to the role of "Reviewer"
Both the site mail and the Reviewers get the email exactly 2 times. I tested to see if the mail was the same or sent a 2nd time. I added a random number to my Subject line. The emails are deferent, iterated.
Steps to reproduce
Drupal 10.1.6
PHP 8.1.21
8.x-3.x-dev
Create a new "Content Moderation Notification" and configure it to send to some role, allow to send to site email. Because sending to recipients via BCC will require at least 1 address in the TO field, you must allow sending to site email, or no mail will be sent.
Create a subject line using random number token like: New invoice: [node:title]-[random:number]
Proposed resolution
I think there is a place where a function gets called twice. I think it could be:
getNotifications()
sendNotification()
content_moderation_notifications_mail()
Remaining tasks
I am still testing to see where this 2nd call may happen.
I don't think this is a browser, reloading the page but I will check more, other browsers.
Thank you for this module! Without it, content moderation core, doesn't really do much.