You are here

function drupal_mail_wrapper in Mandrill 6

Implements drupal_mail_wrapper().

File

./mandrill.mail.inc, line 208
Class for sending mails via Mandrill.

Code

function drupal_mail_wrapper($message) {
  $mandrill_status = variable_get('mandrill_status', MANDRILL_STATUS_ON);
  $mandrill = $mandrill_status == MANDRILL_STATUS_TEST ? new TestingMandrillMailSystem() : new MandrillMailSystem();
  $message = $mandrill
    ->format($message);
  return $mandrill
    ->mail($message);
}