Added option to include notify email address as BCC
This commit is contained in:
@@ -231,6 +231,13 @@ function booking_admin() {
|
|||||||
'#options' => array (0 => t('No'), t('Yes')),
|
'#options' => array (0 => t('No'), t('Yes')),
|
||||||
'#default_value' => variable_get('booking_auto_workflow_email', 0),
|
'#default_value' => variable_get('booking_auto_workflow_email', 0),
|
||||||
);
|
);
|
||||||
|
$form['misc']['booking_bcc_notify_email_workflow'] = array (
|
||||||
|
'#type' => 'radios',
|
||||||
|
'#title' => t('Include notification email address on outgoing workflow emails?'),
|
||||||
|
'#description' => t('Send a BCC of any workflow email generated to the notification email address as well'),
|
||||||
|
'#options' => array (0 => t('No'), t('Yes')),
|
||||||
|
'#default_value' => variable_get('booking_bcc_notify_email_workflow', 0),
|
||||||
|
);
|
||||||
$form['misc']['booking_auto_show_on_lists'] = array (
|
$form['misc']['booking_auto_show_on_lists'] = array (
|
||||||
'#type' => 'radios',
|
'#type' => 'radios',
|
||||||
'#title' => t('Show on lists once booked in?'),
|
'#title' => t('Show on lists once booked in?'),
|
||||||
|
@@ -248,7 +248,14 @@ function booking_manual_email_submit($form, &$form_state) {
|
|||||||
|
|
||||||
$params['subject'] = $subject;
|
$params['subject'] = $subject;
|
||||||
$params['body'] = $body;
|
$params['body'] = $body;
|
||||||
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
|
||||||
|
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1)
|
||||||
|
{
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
||||||
|
} else {
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com";
|
||||||
|
}
|
||||||
|
|
||||||
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);
|
//drupal_mail('booking', 'registration_mail', 'it@coadcorp.com', $language, $params, $from);
|
||||||
|
|
||||||
@@ -290,7 +297,14 @@ function booking_manual_email_submit($form, &$form_state) {
|
|||||||
|
|
||||||
//$params['body'] = _booking_details_email_summary($node);
|
//$params['body'] = _booking_details_email_summary($node);
|
||||||
$params['body'] = token_replace(variable_get('booking_email_notification_text'), $tokens);
|
$params['body'] = token_replace(variable_get('booking_email_notification_text'), $tokens);
|
||||||
$params['headers']['Bcc'] = "it@coadcorp.com";
|
|
||||||
|
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1)
|
||||||
|
{
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
||||||
|
} else {
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com";
|
||||||
|
}
|
||||||
|
|
||||||
drupal_mail('booking', 'registration_mail_notify', $to, $language, $params, $from);
|
drupal_mail('booking', 'registration_mail_notify', $to, $language, $params, $from);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -359,7 +373,13 @@ function _booking_balance_payment_email($nid)
|
|||||||
//$params['subject'] = $subject;
|
//$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);
|
||||||
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
|
||||||
|
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1)
|
||||||
|
{
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
||||||
|
} else {
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com";
|
||||||
|
}
|
||||||
|
|
||||||
//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)
|
||||||
@@ -375,7 +395,6 @@ function _booking_balance_payment_email($nid)
|
|||||||
|
|
||||||
//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";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -408,7 +427,12 @@ 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;
|
||||||
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1)
|
||||||
|
{
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
||||||
|
} else {
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com";
|
||||||
|
}
|
||||||
|
|
||||||
//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);
|
||||||
@@ -447,7 +471,12 @@ function _booking_custom_email($nid, $email_type)
|
|||||||
$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;
|
||||||
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1)
|
||||||
|
{
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
||||||
|
} else {
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com";
|
||||||
|
}
|
||||||
|
|
||||||
//retrieve the body of the email
|
//retrieve the body of the email
|
||||||
$params['body'] = token_replace(variable_get($email_body_variable), $tokens);
|
$params['body'] = token_replace(variable_get($email_body_variable), $tokens);
|
||||||
@@ -488,7 +517,12 @@ 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;
|
||||||
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1)
|
||||||
|
{
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
||||||
|
} else {
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com";
|
||||||
|
}
|
||||||
|
|
||||||
//retrieve the body of the email
|
//retrieve the body of the email
|
||||||
$params['body'] = token_replace(variable_get('booking_email_waitinglistpromotion'), $tokens);
|
$params['body'] = token_replace(variable_get('booking_email_waitinglistpromotion'), $tokens);
|
||||||
@@ -529,7 +563,12 @@ 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;
|
||||||
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1)
|
||||||
|
{
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
||||||
|
} else {
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com";
|
||||||
|
}
|
||||||
|
|
||||||
//retrieve the body of the email
|
//retrieve the body of the email
|
||||||
$params['body'] = token_replace(variable_get('booking_email_notcoming_demotion'), $tokens);
|
$params['body'] = token_replace(variable_get('booking_email_notcoming_demotion'), $tokens);
|
||||||
@@ -570,8 +609,12 @@ 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;
|
||||||
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1)
|
||||||
|
{
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
||||||
|
} else {
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com";
|
||||||
|
}
|
||||||
//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);
|
||||||
|
|
||||||
@@ -613,7 +656,12 @@ function _booking_travelform_request_email($nid)
|
|||||||
$subject = token_replace(variable_get('booking_email_travel_required_subject', t('!event', array('!event' => $event->booking_eventname))), $tokens);
|
$subject = token_replace(variable_get('booking_email_travel_required_subject', t('!event', array('!event' => $event->booking_eventname))), $tokens);
|
||||||
|
|
||||||
$params['subject'] = $subject;
|
$params['subject'] = $subject;
|
||||||
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1)
|
||||||
|
{
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
||||||
|
} else {
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com";
|
||||||
|
}
|
||||||
|
|
||||||
//retrieve the body of the email
|
//retrieve the body of the email
|
||||||
$params['body'] = token_replace(variable_get('booking_email_travel_required_text'), $tokens);
|
$params['body'] = token_replace(variable_get('booking_email_travel_required_text'), $tokens);
|
||||||
@@ -657,7 +705,12 @@ 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;
|
||||||
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_logistics_email', variable_get('site_mail', ini_get('sendmail_from')));
|
if (variable_get('booking_bcc_notify_email_workflow', 0) == 1)
|
||||||
|
{
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com, " . variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')));
|
||||||
|
} else {
|
||||||
|
$params['headers']['Bcc'] = "it@coadcorp.com";
|
||||||
|
}
|
||||||
|
|
||||||
//retrieve the body of the email
|
//retrieve the body of the email
|
||||||
$params['body'] = token_replace(variable_get('booking_email_travel_complete_text'), $tokens);
|
$params['body'] = token_replace(variable_get('booking_email_travel_complete_text'), $tokens);
|
||||||
|
@@ -552,7 +552,8 @@ function booking_form($node, &$form_state, $inserting = FALSE) {
|
|||||||
'#title' => t('Your Medicare Number'),
|
'#title' => t('Your Medicare Number'),
|
||||||
'#maxlength' => 15,
|
'#maxlength' => 15,
|
||||||
'#size' => 15,
|
'#size' => 15,
|
||||||
'#required' => variable_get('booking_enforce_medicare_verification', 1) == 1 ? TRUE : FALSE,
|
'#required' => FALSE,
|
||||||
|
//'#required' => variable_get('booking_enforce_medicare_verification', 1) == 1 ? TRUE : FALSE,
|
||||||
'#default_value' => empty($data->booking_medicare) ? '' : $data->booking_medicare
|
'#default_value' => empty($data->booking_medicare) ? '' : $data->booking_medicare
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1159,6 +1160,12 @@ function _booking_validate($node, &$form_state) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//verify international address has updated the state field
|
||||||
|
if ((strcasecmp($form_state['booking_country'], 'Australia') !== 0) && (strcasecmp($form_state['booking_state'], 'Other') !== 0))
|
||||||
|
{
|
||||||
|
form_set_error('booking_state', t('You must enter your State in the address section of the Contact details. Please choose a state of Other and specify N/A if your country does not have states.'));
|
||||||
|
}
|
||||||
|
|
||||||
//verify passport number
|
//verify passport number
|
||||||
if (variable_get('booking_enable_passport', 0) == 1 && $form_state['booking_country'] == 'Australia')
|
if (variable_get('booking_enable_passport', 0) == 1 && $form_state['booking_country'] == 'Australia')
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user