You are here

function mandrill_sender_plain in Mandrill 7.2

Same name and namespace in other branches
  1. 8 mandrill.module \mandrill_sender_plain()
  2. 7 mandrill.module \mandrill_sender_plain()

The actual function that calls the API send message.

This is the default function used by mandrill_mailsend().

Parameters

array $message: Associative array containing message data.

Return value

array Results of sending the message.

Throws

Mandrill_Error

2 string references to 'mandrill_sender_plain'
MandrillHooksTestCase::testMailAlterHook in tests/mandrill_hooks.test
Tests implementing hook_mandrill_mail_alter().
MandrillMailSystem::mail in lib/mandrill.mail.inc
Send the email message.

File

./mandrill.module, line 268
Enables Drupal to send email directly through Mandrill.

Code

function mandrill_sender_plain($message) {
  if ($mailer = mandrill_get_api_object()) {
    return $mailer->messages
      ->send($message);
  }
  else {
    throw new Mandrill_Error('Missing API key.');
  }
}