You are here

public function AmazonSes::mail in Amazon SES 2.0.x

Sends an email message.

Parameters

array $message: A message array, as described in hook_mail_alter().

Return value

bool TRUE if the mail was successfully accepted, otherwise FALSE.

Overrides PhpMail::mail

See also

http://php.net/manual/function.mail.php

\Drupal\Core\Mail\MailManagerInterface::mail()

File

src/Plugin/Mail/AmazonSes.php, line 88

Class

AmazonSes
Amazon SES mail system plugin.

Namespace

Drupal\amazon_ses\Plugin\Mail

Code

public function mail(array $message) {
  if ($this->config
    ->get('queue')) {
    $result = $this->queue
      ->createItem($message);
    return (bool) $result;
  }
  else {
    $message_id = $this->handler
      ->send($message);
    return (bool) $message_id;
  }
}