You are here

public function MailgunHandler::__construct in Mailgun 8

Constructs a new \Drupal\mailgun\MailHandler object.

Parameters

\Mailgun\Mailgun $mailgun_client: Mailgun PHP SDK Object.

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

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

\Drupal\Core\Messenger\MessengerInterface $messenger: The messenger.

\Drupal\Component\Utility\EmailValidatorInterface $email_validator: The email validator.

File

src/MailgunHandler.php, line 68

Class

MailgunHandler
Mail handler to send out an email message array to the Mailgun API.

Namespace

Drupal\mailgun

Code

public function __construct(Mailgun $mailgun_client, ConfigFactoryInterface $config_factory, LoggerInterface $logger, MessengerInterface $messenger, EmailValidatorInterface $email_validator) {
  $this->mailgunConfig = $config_factory
    ->get(MailgunHandlerInterface::CONFIG_NAME);
  $this->logger = $logger;
  $this->mailgun = $mailgun_client;
  $this->messenger = $messenger;
  $this->emailValidator = $email_validator;
}