theming of email body

This commit is contained in:
2017-06-27 12:17:54 +10:00
parent b1b900dfb3
commit 7e99092df7
2 changed files with 37 additions and 4 deletions

View File

@@ -869,6 +869,32 @@ function booking_mail($key, &$message, $params) {
}
}
/**
* Implements hook_mail_alter()
*/
function booking_mail_alter(&$message) {
// $message['id'] comes from {module_name}_{email_key}
if($message['id'] == 'booking_registration_mail') {
$headers = array(
'MIME-Version' => '1.0',
'Content-Type' => 'text/html; charset=UTF-8; format=flowed',
'Content-Transfer-Encoding' => '8bit',
'X-Mailer' => 'Drupal',
);
}else{
$headers = array(
'MIME-Version' => '1.0',
'Content-Type' => 'text/plain; charset=UTF-8; format=flowed; delsp=yes',
'Content-Transfer-Encoding' => '8bit',
'X-Mailer' => 'Drupal',
);
}
//Overwrite header message header with Content-Type accommodating for html format
foreach($headers as $key => $value) {
$message['headers'][$key] = $value;
}
}
/**
* Implements hook_library().