code cleanup

This commit is contained in:
2017-09-16 12:15:05 +10:00
parent 332dcabd52
commit a8ff994a9d
3 changed files with 2 additions and 347 deletions

View File

@@ -86,32 +86,6 @@ function _booking_registration_email($nid, $balance_payment, $manual = false) {
$themed_body = _booking_generate_html_body($subject, $raw_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;
$message_footer = token_replace($message_footer, $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',
'body' => _booking_registration_email_generate($node, $tokens, $waiting_list, $balance_payment, $manual),
'subject' => $subject,
'footer' => $message_footer,
'links' => _booking_html_emails_links(),
));
//watchdog('booking_debug', "<pre>HTML body themed\n@info</pre>", array('@info' => print_r($html_body, true)));
$params['body'] = $html_body;
}
else {
$body = _booking_registration_email_generate($node, $tokens, $waiting_list, $balance_payment, $manual);
$params['body'] = $body;
}
*/
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')));
}
@@ -168,32 +142,6 @@ function _booking_regn_notifyonly_email($node, $balance_payment) {
$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;
$message_footer = token_replace($message_footer, $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,
'footer' => $message_footer,
'links' => _booking_html_emails_links(),
));
//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')));
}
@@ -294,31 +242,6 @@ function _booking_balance_payment_email($nid) {
$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;
$message_footer = token_replace($message_footer, $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_bal_outstanding',
'body' => $message_body,
'subject' => $subject,
'footer' => $message_footer,
'links' => _booking_html_emails_links(),
));
//watchdog('booking_debug', "<pre>HTML body themed\n@info</pre>", array('@info' => print_r($html_body, true)));
$params['body'] = $html_body;
}
else {
$params['body'] = $message_body;
}
*/
//send the email
drupal_mail('booking', 'registration_mail_bal_outstanding', $to, $language, $params, $from);
}
@@ -366,35 +289,6 @@ function _booking_partialbalance_payment_email($nid) {
$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);
//get the footer text
$message_footer = variable_get('booking_html_mail_footer');
$message_footer = isset($message_footer['format']) ? $message_footer['value'] : $message_footer;
$message_footer = token_replace($message_footer, $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_bal_outstanding',
'body' => $body,
'subject' => $subject,
'footer' => $message_footer,
'links' => _booking_html_emails_links(),
));
//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;
}
*/
//send the email
drupal_mail('booking', 'registration_mail_bal_outstanding', $to, $language, $params, $from);
}
@@ -453,35 +347,7 @@ function _booking_custom_email($nid, $email_type, $sender = 'contact') {
$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;
$message_footer = token_replace($message_footer, $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' => 'booking_email_custom',
'body' => $message_body,
'subject' => $subject,
'footer' => $message_footer,
'links' => _booking_html_emails_links(),
));
//watchdog('booking_debug', "<pre>HTML body themed\n@info</pre>", array('@info' => print_r($html_body, true)));
$params['body'] = $html_body;
}
else {
$params['body'] = $message_body;
}
*/
//retrieve the body of the email
//$params['body'] = token_replace(variable_get($email_body_variable), $tokens);
//send the email to the person
drupal_mail('booking', 'booking_email_custom', $to, $language, $params, $from);
}
@@ -529,34 +395,6 @@ function _booking_promoted_from_waitinglist_email($nid) {
$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;
$message_footer = token_replace($message_footer, $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' => 'booking_email_custom',
'body' => $body,
'subject' => $subject,
'footer' => $message_footer,
'links' => _booking_html_emails_links(),
));
//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;
}
*/
//retrieve the body of the email
//$params['body'] = token_replace(variable_get('booking_email_waitinglistpromotion'), $tokens);
//send the email
drupal_mail('booking', 'booking_email_custom', $to, $language, $params, $from);
}
@@ -606,31 +444,6 @@ function _booking_demoted_to_notcoming_email($nid) {
$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;
$message_footer = token_replace($message_footer, $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' => 'booking_email_custom',
'body' => $body,
'subject' => $subject,
'footer' => $message_footer,
'links' => _booking_html_emails_links(),
));
//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;
}
*/
//send the email
drupal_mail('booking', 'booking_email_custom', $to, $language, $params, $from);
}
@@ -680,31 +493,6 @@ function _booking_missedpayment_email($nid) {
$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;
$message_footer = token_replace($message_footer, $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' => 'booking_email_custom',
'body' => $body,
'subject' => $subject,
'footer' => $message_footer,
'links' => _booking_html_emails_links(),
));
//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;
}
*/
//send the email
drupal_mail('booking', 'booking_email_custom', $to, $language, $params, $from);
}
@@ -754,31 +542,6 @@ function _booking_travelform_initial_request_email($nid) {
$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;
$message_footer = token_replace($message_footer, $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' => 'booking_email_custom',
'body' => $body,
'subject' => $subject,
'footer' => $message_footer,
'links' => _booking_html_emails_links(),
));
//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;
}
*/
//send the email
drupal_mail('booking', 'booking_email_custom', $to, $language, $params, $from);
}
@@ -829,31 +592,6 @@ function _booking_travelform_reminder_request_email($nid) {
$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;
$message_footer = token_replace($message_footer, $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' => 'booking_email_custom',
'body' => $body,
'subject' => $subject,
'footer' => $message_footer,
'links' => _booking_html_emails_links(),
));
//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;
}
*/
//send the email
drupal_mail('booking', 'booking_email_custom', $to, $language, $params, $from);
}
@@ -907,31 +645,6 @@ function _booking_travelform_confirmation_email($nid) {
$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;
$message_footer = token_replace($message_footer, $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' => 'booking_email_custom',
'body' => $body,
'subject' => $subject,
'footer' => $message_footer,
'links' => _booking_html_emails_links(),
));
//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;
}
*/
//send the email
drupal_mail('booking', 'booking_email_custom', $to, $language, $params, $from);
}