You are here

function mandrill_mail in Mandrill 7

Same name and namespace in other branches
  1. 8 mandrill.module \mandrill_mail()
  2. 6 mandrill.module \mandrill_mail()
  3. 7.2 mandrill.module \mandrill_mail()

Implements hook_mail().

File

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

Code

function mandrill_mail($key, &$message, $params) {
  if ($key == 'test') {
    $message['subject'] = $params['subject'];
    $message['body'] = $params['body'];
    if ($params['include_attachment']) {
      $message['attachments'][] = drupal_realpath('misc/druplicon.png');
      $message['body'] .= '  ' . t('The Drupal icon is included as an attachment to test the attachment functionality.');
    }
  }
}