cleanup formatting in email functions

This commit is contained in:
Nathan Coad
2016-07-23 11:36:19 +10:00
parent cc7d8680f3
commit 9e26b69edf
2 changed files with 107 additions and 126 deletions

View File

@@ -6,7 +6,7 @@
* @param $nid - the node id relating to the registration node * @param $nid - the node id relating to the registration node
* @return nothing * @return nothing
*/ */
function _booking_registration_email($nid, $balance_payment, $manual = false) { function _booking_registration_email($nid, $balance_payment, $manual = false) {
global $event; global $event;
global $user; global $user;
$language = user_preferred_language($user); $language = user_preferred_language($user);
@@ -18,7 +18,8 @@
//load the node matching this id //load the node matching this id
$node = node_load($nid); $node = node_load($nid);
watchdog('booking', 'Sending registration email to !first !last', array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname)); watchdog('booking', 'Sending registration email to !first !last',
array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname));
//waiting list has already been calculated, stored in node //waiting list has already been calculated, stored in node
$waiting_list = $node->booking_status == 2 ? TRUE : FALSE; $waiting_list = $node->booking_status == 2 ? TRUE : FALSE;
@@ -31,31 +32,30 @@
//send the registering person an email //send the registering person an email
$to = $node->booking_email; $to = $node->booking_email;
$body = _booking_registration_email_generate($node, $waiting_list, $balance_payment, $manual); $body = _booking_registration_email_generate($node, $waiting_list, $balance_payment, $manual);
if ($balance_payment == TRUE) if ($balance_payment == TRUE) {
$subject = t('!event Payment Complete', array('!event' => $event->booking_eventname)); $subject = t('!event Payment Complete', array('!event' => $event->booking_eventname));
else }
else {
$subject = t('!event Registration', array('!event' => $event->booking_eventname)); $subject = t('!event Registration', array('!event' => $event->booking_eventname));
}
$params['subject'] = $subject; $params['subject'] = $subject;
$params['body'] = $body; $params['body'] = $body;
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1) 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')));
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from'))); }
} else { else {
$params['headers']['Bcc'] = "it@coadcorp.com"; $params['headers']['Bcc'] = BOOKING_EMAIL_DEV_NOTIFY;
} }
drupal_mail('booking', 'registration_mail', $to, $language, $params, $from); drupal_mail('booking', 'registration_mail', $to, $language, $params, $from);
//drupal_mail('booking', 'registration_mail', 'it@coadcorp.com', $language, $params, $from);
//send a notification email if we didn't automatically send one earlier //send a notification email if we didn't automatically send one earlier
if (variable_get('booking_auto_confirm_email', 0) == 1) if (variable_get('booking_auto_confirm_email', 0) == 1) {
{
_booking_regn_notifyonly_email($node, $balance_payment); _booking_regn_notifyonly_email($node, $balance_payment);
} }
}
}
/** /**
* Function to send notification email only, nothing to the end user * Function to send notification email only, nothing to the end user
@@ -63,14 +63,14 @@
* @param $node - variable representing the booking node * @param $node - variable representing the booking node
* @return nothing * @return nothing
*/ */
function _booking_regn_notifyonly_email($node, $balance_payment) function _booking_regn_notifyonly_email($node, $balance_payment) {
{
global $event; global $event;
global $user; global $user;
$language = user_preferred_language($user); $language = user_preferred_language($user);
$tokens = booking_define_personspecific_tokens($node); $tokens = booking_define_personspecific_tokens($node);
watchdog('booking', 'Sending notification email about !first !last', array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname)); watchdog('booking', 'Sending notification email about !first !last',
array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname));
//calculate the from email address //calculate the from email address
$from = t('!event Registrations <!email>', array('!event' => $event->booking_eventname, $from = t('!event Registrations <!email>', array('!event' => $event->booking_eventname,
@@ -80,19 +80,22 @@
//just put the registration info in this email to notify the appropriate people //just put the registration info in this email to notify the appropriate people
$to = variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from'))); $to = variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
if ($balance_payment == TRUE) if ($balance_payment == TRUE) {
$params['subject'] = t('Registration Fully Paid: !first !last', array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname)); $params['subject'] = t('Registration Fully Paid: !first !last',
else array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname));
$params['subject'] = t('New Registration: !first !last', array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname)); }
else {
//$params['body'] = _booking_details_email_summary($node); $params['subject'] = t('New Registration: !first !last',
array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname));
}
$params['body'] = token_replace(variable_get('booking_email_notification_text'), $tokens); $params['body'] = token_replace(variable_get('booking_email_notification_text'), $tokens);
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1) 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')));
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from'))); }
} else { else {
$params['headers']['Bcc'] = "it@coadcorp.com"; $params['headers']['Bcc'] = BOOKING_EMAIL_DEV_NOTIFY;
} }
drupal_mail('booking', 'registration_mail_notify', $to, $language, $params, $from); drupal_mail('booking', 'registration_mail_notify', $to, $language, $params, $from);
@@ -107,20 +110,16 @@
* @return array containing email text * @return array containing email text
*/ */
function _booking_registration_email_generate($node, $waiting_list, $balance_payment, $manual) { function _booking_registration_email_generate($node, $waiting_list, $balance_payment, $manual) {
global $event; global $event;
$tokens = booking_define_personspecific_tokens($node); $tokens = booking_define_personspecific_tokens($node);
if ($balance_payment == True) if ($balance_payment == True) {
{
$contact_message = token_replace(variable_get('booking_email_regn_complete_text'), $tokens); $contact_message = token_replace(variable_get('booking_email_regn_complete_text'), $tokens);
} }
elseif ($waiting_list == False) elseif ($waiting_list == False) {
{
$contact_message = token_replace(variable_get('booking_email_bookedin_text'), $tokens); $contact_message = token_replace(variable_get('booking_email_bookedin_text'), $tokens);
} }
else else {
{
//booking is on the waiting list //booking is on the waiting list
$contact_message = token_replace(variable_get('booking_email_waitinglist_text'), $tokens); $contact_message = token_replace(variable_get('booking_email_waitinglist_text'), $tokens);
} }
@@ -136,8 +135,7 @@
* *
* @param $nid - the registration node * @param $nid - the registration node
*/ */
function _booking_balance_payment_email($nid) function _booking_balance_payment_email($nid) {
{
global $event; global $event;
global $user; global $user;
$language = user_preferred_language($user); $language = user_preferred_language($user);
@@ -146,9 +144,9 @@ function _booking_balance_payment_email($nid)
$node = node_load($nid); $node = node_load($nid);
$tokens = booking_define_personspecific_tokens($node); $tokens = booking_define_personspecific_tokens($node);
if ($tokens['payment-required'] <= 0) if ($tokens['payment-required'] <= 0) {
{ watchdog('booking', "Not sending amount owing email, since this person doesn't owe any money: @info",
watchdog('booking', "Not sending amount owing email, since this person doesn't owe any money: @info", array('@info' => var_export($node, TRUE))); array('@info' => var_export($node, TRUE)));
return; return;
} }
@@ -158,28 +156,25 @@ function _booking_balance_payment_email($nid)
)); ));
//calculate the remaining parameters //calculate the remaining parameters
$to = $node->booking_email; $to = $node->booking_email;
//$subject = t('!event Payment Required', array('!event' => $event->booking_eventname));
//$params['subject'] = $subject;
$params['subject'] = token_replace(variable_get('booking_email_paymentoutstanding_subject', $params['subject'] = token_replace(variable_get('booking_email_paymentoutstanding_subject',
t('!event Payment Required', array('!event' => $event->booking_eventname))), $tokens); t('!event Payment Required', array('!event' => $event->booking_eventname))), $tokens);
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1) 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')));
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from'))); }
} else { else {
$params['headers']['Bcc'] = "it@coadcorp.com"; $params['headers']['Bcc'] = BOOKING_EMAIL_DEV_NOTIFY;
} }
//retrieve the body of the email for a married couple only if we're combining pricing for couples //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) if (variable_get('booking_enable_combined_pricing', 0) == 1 && $node->booking_partner_id > 0) {
{ watchdog('booking', "Sending the married-couple specific outstanding balance email for this person: @info",
watchdog('booking', "Sending the married-couple specific outstanding balance email for this person: @info", array('@info' => var_export($node, TRUE))); array('@info' => var_export($node, TRUE)));
$params['body'] = token_replace(variable_get('booking_email_paymentoutstanding_married_text'), $tokens); $params['body'] = token_replace(variable_get('booking_email_paymentoutstanding_married_text'), $tokens);
} }
//otherwise retrieve the body of the email for individuals //otherwise retrieve the body of the email for individuals
else else {
{
$params['body'] = token_replace(variable_get('booking_email_paymentoutstanding_text'), $tokens); $params['body'] = token_replace(variable_get('booking_email_paymentoutstanding_text'), $tokens);
} }
@@ -192,8 +187,7 @@ function _booking_balance_payment_email($nid)
* *
* @param $nid - the registration node * @param $nid - the registration node
*/ */
function _booking_partialbalance_payment_email($nid) function _booking_partialbalance_payment_email($nid) {
{
global $event; global $event;
global $user; global $user;
$language = user_preferred_language($user); $language = user_preferred_language($user);
@@ -202,8 +196,7 @@ function _booking_partialbalance_payment_email($nid)
$node = node_load($nid); $node = node_load($nid);
$tokens = booking_define_personspecific_tokens($node); $tokens = booking_define_personspecific_tokens($node);
if ($tokens['payment-required'] <= 0) if ($tokens['payment-required'] <= 0) {
{
watchdog('booking', "Not sending amount owing email, since this person doesn't owe any money: @info", array('@info' => var_export($node, TRUE))); watchdog('booking', "Not sending amount owing email, since this person doesn't owe any money: @info", array('@info' => var_export($node, TRUE)));
return; return;
} }
@@ -217,19 +210,18 @@ function _booking_partialbalance_payment_email($nid)
$to = $node->booking_email; $to = $node->booking_email;
$subject = t('!event Partial Payment Received', array('!event' => $event->booking_eventname)); $subject = t('!event Partial Payment Received', array('!event' => $event->booking_eventname));
$params['subject'] = $subject; $params['subject'] = $subject;
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1) 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')));
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from'))); }
} else { else {
$params['headers']['Bcc'] = "it@coadcorp.com"; $params['headers']['Bcc'] = BOOKING_EMAIL_DEV_NOTIFY;
} }
//TODO: Married couple version of this //TODO: Married couple version of this
$params['body'] = token_replace(variable_get('booking_email_partialpayment_received_text'), $tokens); $params['body'] = token_replace(variable_get('booking_email_partialpayment_received_text'), $tokens);
//send the email //send the email
drupal_mail('booking', 'registration_mail_bal_outstanding', $to, $language, $params, $from); drupal_mail('booking', 'registration_mail_bal_outstanding', $to, $language, $params, $from);
//$params['headers']['Bcc'] = "it@coadcorp.com";
} }
@@ -240,8 +232,7 @@ function _booking_partialbalance_payment_email($nid)
* @param $email_type - select which custom email template to use * @param $email_type - select which custom email template to use
* @return nothing * @return nothing
*/ */
function _booking_custom_email($nid, $email_type, $sender = 'contact') function _booking_custom_email($nid, $email_type, $sender = 'contact') {
{
global $event; global $event;
global $user; global $user;
$language = user_preferred_language($user); $language = user_preferred_language($user);
@@ -256,7 +247,8 @@ function _booking_custom_email($nid, $email_type, $sender = 'contact')
$from = t('!event Registrations <!email>', array('!event' => $event->booking_eventname, $from = t('!event Registrations <!email>', array('!event' => $event->booking_eventname,
'!email' => variable_get('booking_contact_email', variable_get('site_mail', ini_get('sendmail_from'))) '!email' => variable_get('booking_contact_email', variable_get('site_mail', ini_get('sendmail_from')))
)); ));
} elseif ($sender == 'logistics') { }
elseif ($sender == 'logistics') {
watchdog('booking_debug', "<pre>Custom logistics email\n@subject\n@body</pre>", watchdog('booking_debug', "<pre>Custom logistics email\n@subject\n@body</pre>",
array('@subject' => $email_subject_variable, '@body' => $email_body_variable)); array('@subject' => $email_subject_variable, '@body' => $email_body_variable));
//calculate the from email address for a logistics email //calculate the from email address for a logistics email
@@ -273,11 +265,11 @@ function _booking_custom_email($nid, $email_type, $sender = 'contact')
$to = $node->booking_email; $to = $node->booking_email;
$subject = token_replace(variable_get($email_subject_variable, t('!event', array('!event' => $event->booking_eventname))), $tokens); $subject = token_replace(variable_get($email_subject_variable, t('!event', array('!event' => $event->booking_eventname))), $tokens);
$params['subject'] = $subject; $params['subject'] = $subject;
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1) 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')));
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from'))); }
} else { else {
$params['headers']['Bcc'] = "it@coadcorp.com"; $params['headers']['Bcc'] = BOOKING_EMAIL_DEV_NOTIFY;
} }
//retrieve the body of the email //retrieve the body of the email
@@ -292,15 +284,13 @@ function _booking_custom_email($nid, $email_type, $sender = 'contact')
* *
* @param $nid - the registration node * @param $nid - the registration node
*/ */
function _booking_promoted_from_waitinglist_email($nid) function _booking_promoted_from_waitinglist_email($nid) {
{
global $event; global $event;
global $user; global $user;
$language = user_preferred_language($user); $language = user_preferred_language($user);
//return without doing anything if we shouldn't send workflow emails //return without doing anything if we shouldn't send workflow emails
if (variable_get('booking_auto_workflow_email', 0) == 0) if (variable_get('booking_auto_workflow_email', 0) == 0) {
{
watchdog('booking', 'Not sending promoted-from-waitinglist email since that feature is currently disabled.'); watchdog('booking', 'Not sending promoted-from-waitinglist email since that feature is currently disabled.');
return; return;
} }
@@ -318,11 +308,11 @@ function _booking_promoted_from_waitinglist_email($nid)
$to = $node->booking_email; $to = $node->booking_email;
$subject = t('!event Position Available', array('!event' => $event->booking_eventname)); $subject = t('!event Position Available', array('!event' => $event->booking_eventname));
$params['subject'] = $subject; $params['subject'] = $subject;
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1) 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')));
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from'))); }
} else { else {
$params['headers']['Bcc'] = "it@coadcorp.com"; $params['headers']['Bcc'] = BOOKING_EMAIL_DEV_NOTIFY;
} }
//retrieve the body of the email //retrieve the body of the email
@@ -337,15 +327,13 @@ function _booking_promoted_from_waitinglist_email($nid)
* *
* @param $nid - the registration node * @param $nid - the registration node
*/ */
function _booking_demoted_to_notcoming_email($nid) function _booking_demoted_to_notcoming_email($nid) {
{
global $event; global $event;
global $user; global $user;
$language = user_preferred_language($user); $language = user_preferred_language($user);
//return without doing anything if we shouldn't send workflow emails //return without doing anything if we shouldn't send workflow emails
if (variable_get('booking_auto_workflow_email', 0) == 0) if (variable_get('booking_auto_workflow_email', 0) == 0) {
{
watchdog('booking', 'Not sending not-coming email since that feature is currently disabled.'); watchdog('booking', 'Not sending not-coming email since that feature is currently disabled.');
return; return;
} }
@@ -364,11 +352,11 @@ function _booking_demoted_to_notcoming_email($nid)
$subject = token_replace(variable_get('booking_email_notcoming_demotion_subject', t('!event', array('!event' => $event->booking_eventname))), $tokens); $subject = token_replace(variable_get('booking_email_notcoming_demotion_subject', t('!event', array('!event' => $event->booking_eventname))), $tokens);
//$subject = t('!event withdrawal confirmation', array('!event' => $event->booking_eventname)); //$subject = t('!event withdrawal confirmation', array('!event' => $event->booking_eventname));
$params['subject'] = $subject; $params['subject'] = $subject;
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1) 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')));
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from'))); }
} else { else {
$params['headers']['Bcc'] = "it@coadcorp.com"; $params['headers']['Bcc'] = BOOKING_EMAIL_DEV_NOTIFY;
} }
//retrieve the body of the email //retrieve the body of the email
@@ -383,15 +371,13 @@ function _booking_demoted_to_notcoming_email($nid)
* *
* @param $nid - the registration node * @param $nid - the registration node
*/ */
function _booking_missedpayment_email($nid) function _booking_missedpayment_email($nid) {
{
global $event; global $event;
global $user; global $user;
$language = user_preferred_language($user); $language = user_preferred_language($user);
//return without doing anything if we shouldn't send workflow emails //return without doing anything if we shouldn't send workflow emails
if (variable_get('booking_auto_workflow_email', 0) == 0) if (variable_get('booking_auto_workflow_email', 0) == 0) {
{
watchdog('booking', 'Not sending missed-payment email since that feature is currently disabled.'); watchdog('booking', 'Not sending missed-payment email since that feature is currently disabled.');
return; return;
} }
@@ -410,11 +396,11 @@ function _booking_missedpayment_email($nid)
$subject = token_replace(variable_get('booking_email_missedpayment_subject', t('!event', array('!event' => $event->booking_eventname))), $tokens); $subject = token_replace(variable_get('booking_email_missedpayment_subject', t('!event', array('!event' => $event->booking_eventname))), $tokens);
//$subject = t('!event withdrawal confirmation', array('!event' => $event->booking_eventname)); //$subject = t('!event withdrawal confirmation', array('!event' => $event->booking_eventname));
$params['subject'] = $subject; $params['subject'] = $subject;
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1) 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')));
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from'))); }
} else { else {
$params['headers']['Bcc'] = "it@coadcorp.com"; $params['headers']['Bcc'] = BOOKING_EMAIL_DEV_NOTIFY;
} }
//retrieve the body of the email //retrieve the body of the email
$params['body'] = token_replace(variable_get('booking_email_missedpayment'), $tokens); $params['body'] = token_replace(variable_get('booking_email_missedpayment'), $tokens);
@@ -428,15 +414,13 @@ function _booking_missedpayment_email($nid)
* *
* @param $nid - the registration node * @param $nid - the registration node
*/ */
function _booking_travelform_initial_request_email($nid) function _booking_travelform_initial_request_email($nid) {
{
global $event; global $event;
global $user; global $user;
$language = user_preferred_language($user); $language = user_preferred_language($user);
//return without doing anything if we shouldn't send workflow emails //return without doing anything if we shouldn't send workflow emails
if (variable_get('booking_auto_workflow_email', 0) == 0) if (variable_get('booking_auto_workflow_email', 0) == 0) {
{
watchdog('booking', 'Not sending travelform initial request email since that feature is currently disabled.'); watchdog('booking', 'Not sending travelform initial request email since that feature is currently disabled.');
return; return;
} }
@@ -455,11 +439,11 @@ function _booking_travelform_initial_request_email($nid)
$subject = token_replace(variable_get('booking_email_travel_initial_email_subject', t('!event', array('!event' => $event->booking_eventname))), $tokens); $subject = token_replace(variable_get('booking_email_travel_initial_email_subject', t('!event', array('!event' => $event->booking_eventname))), $tokens);
$params['subject'] = $subject; $params['subject'] = $subject;
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1) 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')));
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from'))); }
} else { else {
$params['headers']['Bcc'] = "it@coadcorp.com"; $params['headers']['Bcc'] = BOOKING_EMAIL_DEV_NOTIFY;
} }
//retrieve the body of the email //retrieve the body of the email
@@ -475,15 +459,13 @@ function _booking_travelform_initial_request_email($nid)
* *
* @param $nid - the registration node * @param $nid - the registration node
*/ */
function _booking_travelform_reminder_request_email($nid) function _booking_travelform_reminder_request_email($nid) {
{
global $event; global $event;
global $user; global $user;
$language = user_preferred_language($user); $language = user_preferred_language($user);
//return without doing anything if we shouldn't send workflow emails //return without doing anything if we shouldn't send workflow emails
if (variable_get('booking_auto_workflow_email', 0) == 0) if (variable_get('booking_auto_workflow_email', 0) == 0) {
{
watchdog('booking', 'Not sending travelform reminder request email since that feature is currently disabled.'); watchdog('booking', 'Not sending travelform reminder request email since that feature is currently disabled.');
return; return;
} }
@@ -502,11 +484,11 @@ function _booking_travelform_reminder_request_email($nid)
$subject = token_replace(variable_get('booking_email_travel_reminder_email_subject', t('!event', array('!event' => $event->booking_eventname))), $tokens); $subject = token_replace(variable_get('booking_email_travel_reminder_email_subject', t('!event', array('!event' => $event->booking_eventname))), $tokens);
$params['subject'] = $subject; $params['subject'] = $subject;
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1) 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')));
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from'))); }
} else { else {
$params['headers']['Bcc'] = "it@coadcorp.com"; $params['headers']['Bcc'] = BOOKING_EMAIL_DEV_NOTIFY;
} }
//retrieve the body of the email //retrieve the body of the email
@@ -522,15 +504,13 @@ function _booking_travelform_reminder_request_email($nid)
* *
* @param $nid - the registration node * @param $nid - the registration node
*/ */
function _booking_travelform_confirmation_email($nid) function _booking_travelform_confirmation_email($nid) {
{
global $event; global $event;
global $user; global $user;
$language = user_preferred_language($user); $language = user_preferred_language($user);
//return without doing anything if we shouldn't send workflow emails //return without doing anything if we shouldn't send workflow emails
if (variable_get('booking_auto_workflow_email', 0) == 0) if (variable_get('booking_auto_workflow_email', 0) == 0) {
{
watchdog('booking', 'Not sending travelform confirmation email since that feature is currently disabled.'); watchdog('booking', 'Not sending travelform confirmation email since that feature is currently disabled.');
return; return;
} }
@@ -552,11 +532,11 @@ function _booking_travelform_confirmation_email($nid)
//$subject = t('!event Travel Details Received', array('!event' => $event->booking_eventname)); //$subject = t('!event Travel Details Received', array('!event' => $event->booking_eventname));
$params['subject'] = $subject; $params['subject'] = $subject;
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1) 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')));
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from'))); }
} else { else {
$params['headers']['Bcc'] = "it@coadcorp.com"; $params['headers']['Bcc'] = BOOKING_EMAIL_DEV_NOTIFY;
} }
//retrieve the body of the email //retrieve the body of the email

View File

@@ -18,6 +18,7 @@ define('BOOKING_PAYPAL_SUBMIT_URL', 'https://www.paypal.com/cgi-bin/webscr');
define('BOOKING_PAYPAL_SUBMIT_URL_SANDBOX', 'https://www.sandbox.paypal.com/cgi-bin/webscr'); define('BOOKING_PAYPAL_SUBMIT_URL_SANDBOX', 'https://www.sandbox.paypal.com/cgi-bin/webscr');
//@todo should really change this to system/booking/paypal //@todo should really change this to system/booking/paypal
define('BOOKING_PAYPAL_IPN_PATH', 'system/booking_paypal/ipn'); define('BOOKING_PAYPAL_IPN_PATH', 'system/booking_paypal/ipn');
define('BOOKING_EMAIL_DEV_NOTIFY', 'it@coadcorp.com');
// Load the include for various constants // Load the include for various constants
module_load_include('inc', 'booking', 'booking.constants'); module_load_include('inc', 'booking', 'booking.constants');