You are here

public function Mailer::__construct in Simplenews 8

Same name and namespace in other branches
  1. 8.2 src/Mail/Mailer.php \Drupal\simplenews\Mail\Mailer::__construct()
  2. 3.x src/Mail/Mailer.php \Drupal\simplenews\Mail\Mailer::__construct()

Constructs a Mailer.

Parameters

\Drupal\simplenews\Spool\SpoolStorageInterface $spool_storage: The simplenews spool storage.

\Drupal\Core\Mail\MailManagerInterface $mail_manager: The mail manager.

\Drupal\Core\State\StateInterface $state: State service.

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

\Drupal\Core\Session\AccountSwitcherInterface $account_switcher: Account switcher.

\Drupal\Core\Lock\LockBackendInterface $lock: Lock service.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager service.

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.

\Drupal\simplenews\Mail\MailCacheInterface $mail_cache: The simplenews mail cache.

File

src/Mail/Mailer.php, line 134

Class

Mailer
Default Mailer.

Namespace

Drupal\simplenews\Mail

Code

public function __construct(SpoolStorageInterface $spool_storage, MailManagerInterface $mail_manager, StateInterface $state, LoggerInterface $logger, AccountSwitcherInterface $account_switcher, LockBackendInterface $lock, ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, LanguageManagerInterface $language_manager, MailCacheInterface $mail_cache) {
  $this->spoolStorage = $spool_storage;
  $this->mailManager = $mail_manager;
  $this->state = $state;
  $this->logger = $logger;
  $this->accountSwitcher = $account_switcher;
  $this->lock = $lock;
  $this->config = $config_factory
    ->get('simplenews.settings');
  $this->entityTypeManager = $entity_type_manager;
  $this->languageManager = $language_manager;
  $this->mailCache = $mail_cache;
}