From 358b7fdca834ef43e9d933d31efd3f7b900fd6e3 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Wed, 29 Jan 2014 22:47:23 +1100 Subject: [PATCH] Updated email info for married people --- booking.emails.inc | 12 ++++++++++-- booking.tokens.inc | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/booking.emails.inc b/booking.emails.inc index 8f43d12..7b3da22 100644 --- a/booking.emails.inc +++ b/booking.emails.inc @@ -143,8 +143,16 @@ function _booking_balance_payment_email($nid) $subject = t('!event Payment Required', array('!event' => $event->booking_eventname)); $params['subject'] = $subject; - //retrieve the body of the email - $params['body'] = token_replace(variable_get('booking_email_paymentoutstanding_text'), $tokens); + //retrieve the body of the email for a married couple only if we're combining pricing for couples + if (variable_get('booking_enable_combined_pricing', 0) == 1 && $node->booking_partner_id > 0) + { + $params['body'] = token_replace(variable_get('booking_email_paymentoutstanding_married_text'), $tokens); + } + //otherwise retrieve the body of the email for individuals + else + { + $params['body'] = token_replace(variable_get('booking_email_paymentoutstanding_text'), $tokens); + } //send the email drupal_mail('booking', 'registration_mail_bal_outstanding', $to, $language, $params, $from); diff --git a/booking.tokens.inc b/booking.tokens.inc index dcf39c6..be582e5 100644 --- a/booking.tokens.inc +++ b/booking.tokens.inc @@ -317,7 +317,7 @@ $booking_registration_intro_text = variable_get('booking_registration_intro_text '#default_value' => variable_get('booking_email_paymentoutstanding_text', $booking_email_paymentoutstanding_text), ); $form['emails']['booking_email_paymentoutstanding_married_text'] = array( - '#title' => t('Email text to send a married couple reminding them of how much they both owe (combined pricing)'), + '#title' => t('Email text to send a married couple reminding them of how much they both owe (only applies when combined pricing enabled)'), '#type' => 'textarea', //'#format' => 'full_html', '#description' => t(''),