public function SMTPMailSystem::__construct in SMTP Authentication Support 8
Constructs a SMPTMailSystem object.
Parameters
array $configuration: The configuration array.
string $plugin_id: The plug-in ID.
mixed $plugin_definition: The plug-in definition.
\Drupal\Core\Logger\LoggerChannelFactoryInterface $logger: The logger object.
\Drupal\Core\Messenger\Messenger $messenger: The messenger object.
\Drupal\Component\Utility\EmailValidatorInterface $emailValidator: The messenger object.
\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory object.
\Drupal\Core\Session\AccountProxyInterface $account: The current user service.
\Drupal\Core\File\FileSystemInterface $file_system: The file system service.
\Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface $mime_type_guesser: The file mime type guesser service.
File
- src/
Plugin/ Mail/ SMTPMailSystem.php, line 111
Class
- SMTPMailSystem
- Modify the drupal mail system to use smtp when sending emails.
Namespace
Drupal\smtp\Plugin\MailCode
public function __construct(array $configuration, $plugin_id, $plugin_definition, LoggerChannelFactoryInterface $logger, Messenger $messenger, EmailValidatorInterface $emailValidator, ConfigFactoryInterface $config_factory, AccountProxyInterface $account, FileSystemInterface $file_system, MimeTypeGuesserInterface $mime_type_guesser) {
$this->smtpConfig = $config_factory
->get('smtp.settings');
$this->logger = $logger;
$this->messenger = $messenger;
$this->emailValidator = $emailValidator;
$this->configFactory = $config_factory;
$this->currentUser = $account;
$this->fileSystem = $file_system;
$this->mimeTypeGuesser = $mime_type_guesser;
}