diff --git a/booking.emails.inc b/booking.emails.inc index 19eb03e..e6dd79a 100644 --- a/booking.emails.inc +++ b/booking.emails.inc @@ -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', "
HTML body themed\n@info
", 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'))); diff --git a/booking.module b/booking.module index eb51c34..8191dbb 100644 --- a/booking.module +++ b/booking.module @@ -898,7 +898,7 @@ function booking_mail($key, &$message, $params) { */ function booking_mail_alter(&$message) { //message id used here comes from {module_name}_{email_key} - $implemented_message_ids = array('booking_registration_mail', 'booking_booking_email_custom', 'booking_registration_mail_bal_outstanding'); + $implemented_message_ids = array('booking_registration_mail', 'booking_registration_mail_notify', 'booking_booking_email_custom', 'booking_registration_mail_bal_outstanding'); if (in_array($message['id'], $implemented_message_ids)) { //if($message['id'] == 'booking_registration_mail') {