class MailerCaptureServiceProvider
Enforce mailer transport which captures sent messages in a key value store.
Enforces CaptureTransport as the mailer transport service implementation, sidestepping mailer transport factory. As a result, the contents of the system.mail mailer_dsn is irrelevant for transport service construction.
Hierarchy
- class \Drupal\mailer_capture\MailerCaptureServiceProvider implements \Drupal\Core\DependencyInjection\ServiceModifierInterface
Expanded class hierarchy of MailerCaptureServiceProvider
File
-
core/
modules/ mailer/ tests/ modules/ mailer_capture/ src/ MailerCaptureServiceProvider.php, line 23
Namespace
Drupal\mailer_captureView source
class MailerCaptureServiceProvider implements ServiceModifierInterface {
/**
* {@inheritdoc}
*/
public function alter(ContainerBuilder $container) : void {
$definition = new Definition(CaptureTransport::class, [
new Reference(EventDispatcherInterface::class),
]);
$definition->addMethodCall('setKeyValueFactory', [
new Reference(KeyValueFactoryInterface::class),
]);
$container->setDefinition(TransportInterface::class, $definition->setPublic(TRUE));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.