public function Mailer::__construct in Simplenews 3.x
Same name and namespace in other branches
- 8.2 src/Mail/Mailer.php \Drupal\simplenews\Mail\Mailer::__construct()
- 8 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.
\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.
File
- src/
Mail/ Mailer.php, line 164
Class
- Mailer
- Default Mailer.
Namespace
Drupal\simplenews\MailCode
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, ModuleHandlerInterface $module_handler) {
$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;
$this->moduleHandler = $module_handler;
}