make email generation more consistent
This commit is contained in:
@@ -161,11 +161,14 @@ function _booking_regn_notifyonly_email($node, $balance_payment) {
|
||||
}
|
||||
$params['subject'] = $subject;
|
||||
|
||||
$body = variable_get('booking_email_notification_text');
|
||||
$message_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);
|
||||
$message_body = isset($message_body['format']) ? $message_body['value'] : $message_body;
|
||||
$message_body = token_replace($message_body, $tokens);
|
||||
$themed_body = _booking_generate_html_body($subject, $message_body, $tokens);
|
||||
$params['body'] = $themed_body;
|
||||
|
||||
/*
|
||||
//get the footer text
|
||||
$message_footer = variable_get('booking_html_mail_footer');
|
||||
$message_footer = isset($message_footer['format']) ? $message_footer['value'] : $message_footer;
|
||||
@@ -188,7 +191,7 @@ function _booking_regn_notifyonly_email($node, $balance_payment) {
|
||||
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) {
|
||||
@@ -265,9 +268,8 @@ function _booking_balance_payment_email($nid) {
|
||||
|
||||
//calculate the remaining parameters
|
||||
$to = $node->booking_email;
|
||||
$params['subject'] = token_replace(variable_get('booking_email_paymentoutstanding_subject',
|
||||
$subject = token_replace(variable_get('booking_email_paymentoutstanding_subject',
|
||||
t('!event Payment Required', array('!event' => $event->booking_eventname))), $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')));
|
||||
}
|
||||
@@ -288,7 +290,11 @@ function _booking_balance_payment_email($nid) {
|
||||
|
||||
$message_body = isset($message_body['format']) ? $message_body['value'] : $message_body;
|
||||
$message_body = token_replace($message_body, $tokens);
|
||||
$themed_body = _booking_generate_html_body($subject, $message_body, $tokens);
|
||||
$params['subject'] = $subject;
|
||||
$params['body'] = $themed_body;
|
||||
|
||||
/*
|
||||
//get the footer text
|
||||
$message_footer = variable_get('booking_html_mail_footer');
|
||||
$message_footer = isset($message_footer['format']) ? $message_footer['value'] : $message_footer;
|
||||
@@ -311,7 +317,8 @@ function _booking_balance_payment_email($nid) {
|
||||
else {
|
||||
$params['body'] = $message_body;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
//send the email
|
||||
drupal_mail('booking', 'registration_mail_bal_outstanding', $to, $language, $params, $from);
|
||||
}
|
||||
@@ -353,7 +360,13 @@ function _booking_partialbalance_payment_email($nid) {
|
||||
|
||||
//TODO: Married couple version of this
|
||||
|
||||
$body = variable_get('booking_email_partialpayment_received_text');
|
||||
$message_body = variable_get('booking_email_partialpayment_received_text');
|
||||
$message_body = isset($message_body['format']) ? $message_body['value'] : $message_body;
|
||||
$message_body = token_replace($message_body, $tokens);
|
||||
$themed_body = _booking_generate_html_body($subject, $message_body, $tokens);
|
||||
$params['body'] = $themed_body;
|
||||
|
||||
/*
|
||||
//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);
|
||||
@@ -380,7 +393,8 @@ function _booking_partialbalance_payment_email($nid) {
|
||||
else {
|
||||
$params['body'] = $body;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
//send the email
|
||||
drupal_mail('booking', 'registration_mail_bal_outstanding', $to, $language, $params, $from);
|
||||
}
|
||||
@@ -437,7 +451,10 @@ function _booking_custom_email($nid, $email_type, $sender = 'contact') {
|
||||
$message_body = variable_get($email_body_variable);
|
||||
$message_body = isset($message_body['format']) ? $message_body['value'] : $message_body;
|
||||
$message_body = token_replace($message_body, $tokens);
|
||||
|
||||
$themed_body = _booking_generate_html_body($subject, $message_body, $tokens);
|
||||
$params['body'] = $themed_body;
|
||||
|
||||
/*
|
||||
//get the footer text
|
||||
$message_footer = variable_get('booking_html_mail_footer');
|
||||
$message_footer = isset($message_footer['format']) ? $message_footer['value'] : $message_footer;
|
||||
@@ -460,7 +477,7 @@ function _booking_custom_email($nid, $email_type, $sender = 'contact') {
|
||||
else {
|
||||
$params['body'] = $message_body;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
//retrieve the body of the email
|
||||
//$params['body'] = token_replace(variable_get($email_body_variable), $tokens);
|
||||
@@ -505,11 +522,14 @@ function _booking_promoted_from_waitinglist_email($nid) {
|
||||
$params['headers']['Bcc'] = BOOKING_EMAIL_DEV_NOTIFY;
|
||||
}
|
||||
|
||||
$body = variable_get('booking_email_waitinglistpromotion');
|
||||
$message_body = variable_get('booking_email_waitinglistpromotion');
|
||||
//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);
|
||||
$message_body = isset($message_body['format']) ? $message_body['value'] : $message_body;
|
||||
$message_body = token_replace($message_body, $tokens);
|
||||
$themed_body = _booking_generate_html_body($subject, $message_body, $tokens);
|
||||
$params['body'] = $themed_body;
|
||||
|
||||
/*
|
||||
//get the footer text
|
||||
$message_footer = variable_get('booking_html_mail_footer');
|
||||
$message_footer = isset($message_footer['format']) ? $message_footer['value'] : $message_footer;
|
||||
@@ -532,7 +552,8 @@ function _booking_promoted_from_waitinglist_email($nid) {
|
||||
else {
|
||||
$params['body'] = $body;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
//retrieve the body of the email
|
||||
//$params['body'] = token_replace(variable_get('booking_email_waitinglistpromotion'), $tokens);
|
||||
|
||||
@@ -578,13 +599,14 @@ function _booking_demoted_to_notcoming_email($nid) {
|
||||
}
|
||||
|
||||
//retrieve the body of the email
|
||||
//$params['body'] = token_replace(variable_get('booking_email_notcoming_demotion'), $tokens);
|
||||
|
||||
$body = variable_get('booking_email_notcoming_demotion');
|
||||
$message_body = variable_get('booking_email_notcoming_demotion');
|
||||
//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);
|
||||
$message_body = isset($message_body['format']) ? $message_body['value'] : $message_body;
|
||||
$message_body = token_replace($message_body, $tokens);
|
||||
$themed_body = _booking_generate_html_body($subject, $message_body, $tokens);
|
||||
$params['body'] = $themed_body;
|
||||
|
||||
/*
|
||||
//get the footer text
|
||||
$message_footer = variable_get('booking_html_mail_footer');
|
||||
$message_footer = isset($message_footer['format']) ? $message_footer['value'] : $message_footer;
|
||||
@@ -607,7 +629,8 @@ function _booking_demoted_to_notcoming_email($nid) {
|
||||
else {
|
||||
$params['body'] = $body;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
//send the email
|
||||
drupal_mail('booking', 'booking_email_custom', $to, $language, $params, $from);
|
||||
}
|
||||
@@ -648,14 +671,16 @@ function _booking_missedpayment_email($nid) {
|
||||
else {
|
||||
$params['headers']['Bcc'] = BOOKING_EMAIL_DEV_NOTIFY;
|
||||
}
|
||||
|
||||
//retrieve the body of the email
|
||||
//$params['body'] = token_replace(variable_get('booking_email_missedpayment'), $tokens);
|
||||
|
||||
$body = variable_get('booking_email_missedpayment');
|
||||
$message_body = variable_get('booking_email_missedpayment');
|
||||
//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);
|
||||
$message_body = isset($message_body['format']) ? $message_body['value'] : $message_body;
|
||||
$message_body = token_replace($message_body, $tokens);
|
||||
$themed_body = _booking_generate_html_body($subject, $message_body, $tokens);
|
||||
$params['body'] = $themed_body;
|
||||
|
||||
/*
|
||||
//get the footer text
|
||||
$message_footer = variable_get('booking_html_mail_footer');
|
||||
$message_footer = isset($message_footer['format']) ? $message_footer['value'] : $message_footer;
|
||||
@@ -678,7 +703,8 @@ function _booking_missedpayment_email($nid) {
|
||||
else {
|
||||
$params['body'] = $body;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
//send the email
|
||||
drupal_mail('booking', 'booking_email_custom', $to, $language, $params, $from);
|
||||
}
|
||||
@@ -719,15 +745,16 @@ function _booking_travelform_initial_request_email($nid) {
|
||||
else {
|
||||
$params['headers']['Bcc'] = BOOKING_EMAIL_DEV_NOTIFY;
|
||||
}
|
||||
|
||||
|
||||
//retrieve the body of the email
|
||||
//$params['body'] = token_replace(variable_get('booking_email_travel_initial_email_text'), $tokens);
|
||||
|
||||
$body = variable_get('booking_email_travel_initial_email_text');
|
||||
$message_body = variable_get('booking_email_travel_initial_email_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);
|
||||
$message_body = isset($message_body['format']) ? $message_body['value'] : $message_body;
|
||||
$message_body = token_replace($message_body, $tokens);
|
||||
$themed_body = _booking_generate_html_body($subject, $message_body, $tokens);
|
||||
$params['body'] = $themed_body;
|
||||
|
||||
/*
|
||||
//get the footer text
|
||||
$message_footer = variable_get('booking_html_mail_footer');
|
||||
$message_footer = isset($message_footer['format']) ? $message_footer['value'] : $message_footer;
|
||||
@@ -749,7 +776,8 @@ function _booking_travelform_initial_request_email($nid) {
|
||||
}
|
||||
else {
|
||||
$params['body'] = $body;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
//send the email
|
||||
drupal_mail('booking', 'booking_email_custom', $to, $language, $params, $from);
|
||||
@@ -792,15 +820,16 @@ function _booking_travelform_reminder_request_email($nid) {
|
||||
else {
|
||||
$params['headers']['Bcc'] = BOOKING_EMAIL_DEV_NOTIFY;
|
||||
}
|
||||
|
||||
|
||||
//retrieve the body of the email
|
||||
//$params['body'] = token_replace(variable_get('booking_email_travel_reminder_email_text'), $tokens);
|
||||
|
||||
$body = variable_get('booking_email_travel_reminder_email_text');
|
||||
$message_body = variable_get('booking_email_travel_reminder_email_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);
|
||||
$message_body = isset($message_body['format']) ? $message_body['value'] : $message_body;
|
||||
$message_body = token_replace($message_body, $tokens);
|
||||
$themed_body = _booking_generate_html_body($subject, $message_body, $tokens);
|
||||
$params['body'] = $themed_body;
|
||||
|
||||
/*
|
||||
//get the footer text
|
||||
$message_footer = variable_get('booking_html_mail_footer');
|
||||
$message_footer = isset($message_footer['format']) ? $message_footer['value'] : $message_footer;
|
||||
@@ -823,6 +852,7 @@ function _booking_travelform_reminder_request_email($nid) {
|
||||
else {
|
||||
$params['body'] = $body;
|
||||
}
|
||||
*/
|
||||
|
||||
//send the email
|
||||
drupal_mail('booking', 'booking_email_custom', $to, $language, $params, $from);
|
||||
@@ -868,15 +898,16 @@ function _booking_travelform_confirmation_email($nid) {
|
||||
else {
|
||||
$params['headers']['Bcc'] = BOOKING_EMAIL_DEV_NOTIFY;
|
||||
}
|
||||
|
||||
|
||||
//retrieve the body of the email
|
||||
//$params['body'] = token_replace(variable_get('booking_email_travel_complete_text'), $tokens);
|
||||
|
||||
$body = variable_get('booking_email_travel_complete_text');
|
||||
$message_body = variable_get('booking_email_travel_complete_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);
|
||||
$message_body = isset($message_body['format']) ? $message_body['value'] : $message_body;
|
||||
$message_body = token_replace($message_body, $tokens);
|
||||
$themed_body = _booking_generate_html_body($subject, $message_body, $tokens);
|
||||
$params['body'] = $themed_body;
|
||||
|
||||
/*
|
||||
//get the footer text
|
||||
$message_footer = variable_get('booking_html_mail_footer');
|
||||
$message_footer = isset($message_footer['format']) ? $message_footer['value'] : $message_footer;
|
||||
@@ -899,6 +930,7 @@ function _booking_travelform_confirmation_email($nid) {
|
||||
else {
|
||||
$params['body'] = $body;
|
||||
}
|
||||
*/
|
||||
|
||||
//send the email
|
||||
drupal_mail('booking', 'booking_email_custom', $to, $language, $params, $from);
|
||||
|
@@ -20,7 +20,7 @@
|
||||
$social_links = json_decode(variable_get('booking_mailtemplate_social_links'), TRUE);
|
||||
|
||||
//watchdog('booking_debug', "<pre>Mail template navigation links loaded\n@info</pre>", array('@info' => print_r($header_links, true)));
|
||||
watchdog('booking_debug', "<pre>Mail template social links loaded\n@info</pre>", array('@info' => print_r($social_links, true)));
|
||||
//watchdog('booking_debug', "<pre>Mail template social links loaded\n@info</pre>", array('@info' => print_r($social_links, true)));
|
||||
|
||||
$form['colors'] = array(
|
||||
'#type' => 'fieldset',
|
||||
@@ -193,7 +193,7 @@ function booking_mailtemplate_form_submit($form, &$form_state)
|
||||
'booking_mailtemplate_header_image_url', 'booking_mailtemplate_header_link_url',
|
||||
);
|
||||
//'booking_mailtemplate_link_color',
|
||||
|
||||
|
||||
//set all the values that are just using the builtin drupal variable definitions
|
||||
foreach ($values as $key => $value) {
|
||||
if (in_array($key, $colors_variable_list, FALSE)) {
|
||||
|
Reference in New Issue
Block a user