"Disable the site email address" breaks the workflow even using Adhoc recipients

Created on 15 December 2020, almost 4 years ago
Updated 26 July 2023, about 1 year ago

Problem/Motivation

When activating the "Disable the site email address" option, mailer "To" seems to be empty if there are only
Adhoc email addresses stablished, Drupal fails and content won't be created of modified.

The website encountered an unexpected error. Please try again later.

Drupal\Core\Entity\EntityStorageException: Invalid address: (to): in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 810 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
PHPMailer\PHPMailer\PHPMailer->addAddress('', '') (Line: 287)
Drupal\smtp\Plugin\Mail\SMTPMailSystem->mail(Array) (Line: 307)
Drupal\Core\Mail\MailManager->doMail('content_moderation_notifications', 'content_moderation_notification', '', 'en', Array, NULL, 1) (Line: 179)

Steps to reproduce

Activate "Disable the site email address" in a workflow notification, set any Adhoc email addresses, trigger this workflow notification.

Proposed resolution

If most people is using this patch, they can be manually setting the "To", hence avoiding this issue, but this is still a work in progress and I don't need that much functionalities:

https://www.drupal.org/project/content_moderation_notifications/issues/2... 🌱 Support Twig, TO, CC, BCC, FROM, REPLY-TO, SUBJECT, Message, Abort, Debugging and Tips Active
Tried mailsystem to force SMTP treat (just in case), didn't work:
https://www.drupal.org/project/content_moderation_notifications/issues/2... β†’

πŸ› Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain RamiroJGC

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024