You are here

public function SwiftMailer::__construct in Swift Mailer 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Mail/SwiftMailer.php \Drupal\swiftmailer\Plugin\Mail\SwiftMailer::__construct()

SwiftMailer constructor.

Parameters

\Drupal\swiftmailer\TransportFactoryInterface $transport_factory: The transport factory service.

\Drupal\Core\Config\ImmutableConfig $message: The swiftmailer message configuration.

\Psr\Log\LoggerInterface $logger: A logger instance.

\Drupal\Core\Render\RendererInterface $renderer: The renderer.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

File

src/Plugin/Mail/SwiftMailer.php, line 89

Class

SwiftMailer
Provides a 'Swift Mailer' plugin to send emails.

Namespace

Drupal\swiftmailer\Plugin\Mail

Code

public function __construct(TransportFactoryInterface $transport_factory, ImmutableConfig $message, LoggerInterface $logger, RendererInterface $renderer, ModuleHandlerInterface $module_handler) {
  $this->transportFactory = $transport_factory;
  $this->config['message'] = $message
    ->get();
  $this->logger = $logger;
  $this->renderer = $renderer;
  $this->moduleHandler = $module_handler;
}