You are here

function forward_mail_alter in Forward 8.2

Same name and namespace in other branches
  1. 8.3 forward.module \forward_mail_alter()
  2. 8 forward.module \forward_mail_alter()
  3. 4.x forward.module \forward_mail_alter()
  4. 4.0.x forward.module \forward_mail_alter()

Implements hook_mail_alter().

File

./forward.module, line 180
Allows forwarding of entities by email.

Code

function forward_mail_alter(&$message) {
  if ($message['module'] == 'forward') {
    if ($message['key'] == 'mail_entity' || $message['key'] == 'send_entity') {
      if (!empty($message['params']['plain_text'])) {
        $message['headers']['Content-Type'] = 'text/plain; charset=utf-8';
      }
      else {
        $message['headers']['Content-Type'] = 'text/html; charset=utf-8';
      }
      $message['headers']['MIME-Version'] = '1.0';
      $message['headers']['Reply-to'] = $message['params']['headers']['Reply-To'];
      $message['headers']['Sender'] = $message['headers']['From'];
    }
  }
}