You are here

public function MailsystemServiceProvider::alter in Mail System 8.4

Modifies existing service definitions.

Parameters

ContainerBuilder $container: The ContainerBuilder whose service definitions can be altered.

Overrides ServiceModifierInterface::alter

File

src/MailsystemServiceProvider.php, line 24

Class

MailsystemServiceProvider
Defines the Mailsystem service provider.

Namespace

Drupal\mailsystem

Code

public function alter(ContainerBuilder $container) {

  // Overrides mail-factory class to use our own mail manager.
  $container
    ->getDefinition('plugin.manager.mail')
    ->setClass('Drupal\\mailsystem\\MailsystemManager')
    ->addMethodCall('setThemeManager', [
    new Reference('theme.manager'),
  ])
    ->addMethodCall('setThemeInitialization', [
    new Reference('theme.initialization'),
  ]);
}