From 83d3b57d1d6aaed691771b51abb10e5815cc70b6 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Tue, 27 Jun 2017 22:06:19 +1000 Subject: [PATCH] add emails types to hook --- booking.emails.inc | 4 ++-- booking.module | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/booking.emails.inc b/booking.emails.inc index dedea3c..19eb03e 100644 --- a/booking.emails.inc +++ b/booking.emails.inc @@ -210,7 +210,7 @@ function _booking_balance_payment_email($nid) { $html_body = theme('booking_htmlmail_registration_mail', array( 'module' => 'booking', - 'key' => 'registration_mail', + 'key' => 'registration_mail_bal_outstanding', 'body' => $message_body, 'subject' => $subject, )); @@ -325,7 +325,7 @@ function _booking_custom_email($nid, $email_type, $sender = 'contact') { $html_body = theme('booking_htmlmail_registration_mail', array( 'module' => 'booking', - 'key' => 'registration_mail', + 'key' => 'booking_email_custom', 'body' => $message_body, 'subject' => $subject, )); diff --git a/booking.module b/booking.module index 33b7158..b9287ec 100644 --- a/booking.module +++ b/booking.module @@ -877,7 +877,10 @@ function booking_mail($key, &$message, $params) { */ function booking_mail_alter(&$message) { // $message['id'] comes from {module_name}_{email_key} - if($message['id'] == 'booking_registration_mail') { + $implemented_message_ids = array('booking_registration_mail', 'booking_email_custom', 'registration_mail_bal_outstanding'); + + if (in_array($message['id'], $implemented_message_ids)) { + //if($message['id'] == 'booking_registration_mail') { watchdog('booking_debug', "Message key matched in booking_mail_alter, setting to html email."); $headers = array( 'MIME-Version' => '1.0',