You are here

function mailhandler_mail in Mailhandler 6

Same name and namespace in other branches
  1. 7 mailhandler.module \mailhandler_mail()

Implementation of hook_mail().

File

./mailhandler.module, line 1102
Mailhandler module code.

Code

function mailhandler_mail($key, &$message, $params) {
  $variables = array(
    '!body' => $params['body'],
    '!from' => $params['from'],
    '!site_name' => variable_get('site_name', 'Drupal'),
    '!subject' => $params['header']->subject,
    '!type' => $params['node']->type,
  );
  $message['subject'] = t('Email submission to !site_name failed - !subject', $variables);
  $message['body'][] = $params['error_text'];
  foreach ($params['error_messages'] as $key => $error) {
    $message['body'][$key] = decode_entities(strip_tags($error));
  }
  $message['body'][] = t("You sent:\n\nFrom: !from\nSubject: !subject\nBody:\n!body", $variables);
}