Avoid empty TO header

Created on 19 January 2024, 11 months ago
Updated 2 February 2024, 11 months ago

Problem/Motivation

When the option "Disable the site email address" is true and there is any email address in the adhoc field, the addresses will be set to "BCC" header and there will not be "TO" header. It's not really a big deal nor issue but if like me, you're on a project that only sends notifications to a specific email address that isn't the site's email, it's a bit annoying.

Steps to reproduce

Classic use of the module.

Proposed resolution

In the file "content_moderation_notifications/src/Notification.php", I check if the variable $recipient is set. If it's not, set this variable to the first email specified in the adhoc field and remove it from BCC header. This patch is for the moment just a quick workaround to fix this issue on a customer website. If needed, I'll clean the code and add a help text in the adhoc field to explain.

Remaining tasks

  1. Clean the code
  2. Test with multiple addresses specified in adhoc field
  3. Add help text to the configuration to explain that it'll be the first email address in the adhoc field that will be taken

User interface changes

None for the moment.

API changes

None.

Data model changes

None.

📌 Task
Status

Fixed

Version

3.6

Component

Code

Created by

🇨🇭Switzerland zilloww

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024