Skip to content

Instantly share code, notes, and snippets.

@rabellamy
Last active August 29, 2015 13:57
Show Gist options
  • Save rabellamy/9673149 to your computer and use it in GitHub Desktop.
Save rabellamy/9673149 to your computer and use it in GitHub Desktop.
/**
*
*/
class ContactFormMailSystem extends DefaultMailSystem {
public function format(array $message) {
$message['body'] = implode("\n\n", $message['body']);
$message['body'] = drupal_wrap_mail($message['body']);
return $message;
}
}
/**
* Implements hook_mail().
* @param $key
* @param $message
* @param $params
*/
function HOOK_mail($key, &$message, $params) {
$language = $message['language'];
switch ($key) {
case 'HOOK_email':
$message['headers']['Content-Type'] = 'text/html; charset=UTF-8;';
$message['subject'] = t('YOUR SUBJECT');
$message['body'][] = $params['body'];
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment