update theming for notification email

This commit is contained in:
2017-06-29 13:12:11 +10:00
parent f4116040c1
commit a0f5f259fd
2 changed files with 23 additions and 2 deletions

View File

@@ -105,7 +105,28 @@ function _booking_regn_notifyonly_email($node, $balance_payment) {
array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname));
}
$params['body'] = token_replace(variable_get('booking_email_notification_text'), $tokens);
$body = variable_get('booking_email_notification_text');
//Use the value of the field if it is an array from a HTML textarea
$body = isset($body['format']) ? $body['value'] : $body;
$body = token_replace($body, $tokens);
//Check if we should apply a HTML theme to the email text or just send a normal email
if(variable_get('booking_enable_html_mail', 0) == 1) {
$html_body = theme('booking_htmlmail_registration_mail',
array(
'module' => 'booking',
'key' => 'registration_mail_notify',
'body' => $body,
'subject' => $subject,
));
watchdog('booking_debug', "<pre>HTML body themed\n@info</pre>", array('@info' => print_r($html_body, true)));
$params['body'] = $html_body;
}
else {
$params['body'] = $body;
}
//$params['body'] = token_replace(variable_get('booking_email_notification_text'), $tokens);
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1) {
$params['headers']['Bcc'] = variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));