- Issue created by @mvonfrie
Drupal\symfony_mailer\MailManagerReplacement
extends the core MailManager implementation but it only overrides the implementation of the mail()
function, but not of getInstance()
which retrieves the "instance of the mail plugin to use for a given message ID". It does it by reading the system.mail
configuration which it not used by Symfony Mailer anymore. And in some cases the configuration might not even exist. This can lead to strange errors.
Therefore, the MailManagerReplacement should override getInstance()
and return the correct instance which must be an implementation of Drupal\Core\Mail\MailInterface
.
Install and configure Symfony Mailer and Webform (>= 6.2).
Create a webform with an email handler.
Test sending the email, it should be created using the Drupal\symfony_mailer\Plugin\EmailBuilder\LegacyEmailBuilder
.
Install the Webprofiler module and enable it's mail toolbat item to track sent emails.
in my case this leads to the following error(s) logged:
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" plugin does not exist. Valid plugin IDs for Drupal\symfony_mailer\MailManagerReplacement are: devel_mail_log, webform_php_mail, symfony_mailer, php_mail, test_mail_collector in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (Zeile 53 in web/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).
Drupal\Core\Entity\EntityStorageException: The "" plugin does not exist. Valid plugin IDs for Drupal\symfony_mailer\MailManagerReplacement are: devel_mail_log, webform_php_mail, symfony_mailer, php_mail, test_mail_collector in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (Zeile 817 in web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Uncaught PHP Exception Drupal\Core\Entity\EntityStorageException: "The "" plugin does not exist. Valid plugin IDs for Drupal\symfony_mailer\MailManagerReplacement are: devel_mail_log, webform_php_mail, symfony_mailer, php_mail, test_mail_collector" at SqlContentEntityStorage.php line 817
All three errors contain the same error message but don't give any clue where exactly or why it has been caused. I found this cause by extensive debugging only.
Active
1.4
Code