You are here

function sendgrid_integration_mail in SendGrid Integration 7

Same name and namespace in other branches
  1. 8.2 sendgrid_integration.module \sendgrid_integration_mail()
  2. 8 sendgrid_integration.module \sendgrid_integration_mail()

Implements hook_mail().

File

./sendgrid_integration.module, line 198
Main module file for SendGrid Integration.

Code

function sendgrid_integration_mail($key, &$message, $params) {
  $message['module'] = 'sendgrid_integration';
  $message['key'] = $key;
  $message['subject'] = $params['subject'];
  $message['body'] = explode(MAIL_LINE_ENDINGS . MAIL_LINE_ENDINGS, $params['body']);
  if ($params['include_test_attachment']) {
    $message['attachments'][] = drupal_realpath('misc/druplicon.png');
  }
  if (isset($params['Reply-To']) && !empty($params['Reply-To'])) {
    $message['headers']['Reply-To'] = $params['Reply-To'];
  }
}