You are here

function reroute_email_mail in Reroute Email 6

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

Implements hook_mail().

File

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

Code

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