diff --git a/core/lib/Drupal/Core/Mail/MailManager.php b/core/lib/Drupal/Core/Mail/MailManager.php index 89703c8..9f01281 100644 --- a/core/lib/Drupal/Core/Mail/MailManager.php +++ b/core/lib/Drupal/Core/Mail/MailManager.php @@ -50,7 +50,8 @@ class MailManager extends DefaultPluginManager { * The configuration factory. */ public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, LanguageManagerInterface $language_manager, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory) { - parent::__construct('Plugin/Mail', $namespaces); + parent::__construct('Plugin/Mail', $namespaces, 'Drupal\Core\Annotation\Mail'); + $this->alterInfo($module_handler, 'mail_backend_info'); $this->setCacheBackend($cache_backend, $language_manager, 'mail_backend_plugins'); $this->mailConfig = $config_factory->get('system.mail'); } diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index 59dfce0..ae76395 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -2616,6 +2616,19 @@ function hook_archiver_info_alter(&$info) { } /** + * Alter the list of mail backend plugin definitions. + * + * @param array $info + * The mail backend plugin definitions to be altered. + * + * @see \Drupal\Core\Annotation\Mail + * @see \Drupal\Core\Mail\MailManager + */ +function hook_mail_backend_info_alter(&$info) { + unset($info['test_mail_collector']); +} + +/** * Alters theme operation links. * * @param $theme_groups