You are here

function reroute_email_mail in Reroute Email 7

Same name and namespace in other branches
  1. 8 reroute_email.module \reroute_email_mail()
  2. 6 reroute_email.module \reroute_email_mail()
  3. 2.x reroute_email.module \reroute_email_mail()

Implements hook_mail().

File

./reroute_email.module, line 219
Intercepts all outgoing emails to be rerouted to a configurable destination.

Code

function reroute_email_mail($key, &$message, $params) {
  if ('reroute_email_test_email_form' !== $message['id']) {
    return;
  }
  $message['headers']['Cc'] = $params['cc'];
  $message['headers']['Bcc'] = $params['bcc'];
  $message['subject'] = $params['subject'];
  $message['body'][] = $params['body'];
}