split up some of the email functions for easier management

This commit is contained in:
2016-05-31 17:06:27 +10:00
parent 071ccba847
commit 02deeef731
6 changed files with 413 additions and 388 deletions

View File

@@ -1,5 +1,4 @@
<?php
// $Id: booking.admin.inc,v 0.1 2011/07/12
/**
* @file
@@ -330,165 +329,6 @@ $booking_registration_intro_text = variable_get('booking_registration_intro_text
'#default_value' => variable_get('booking_travelform_completed_page', ''),
);
/*Text for emails*/
$form['emails'] = array(
'#type' => 'fieldset',
'#title' => 'Built-In Workflow Email Definitions',
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$form['emails']['booking_email_notification_text'] = array(
'#title' => t('Notification Email'),
'#type' => 'textarea',
//'#format' => 'full_html',
'#description' => t('Email to send to the notification email address (defined in general configuration) when a person has registered'),
'#default_value' => variable_get('booking_email_notification_text', '[booking:regn-summary]'),
);
$form['emails']['booking_email_bookedin_text'] = array(
'#title' => t('Registration Successful Email'),
'#type' => 'textarea',
//'#format' => 'full_html',
'#description' => t('Text to use in an email indicating the person has booked in, paid their deposit and is not on the waiting list'),
'#default_value' => variable_get('booking_email_bookedin_text', $default_email_text),
);
$form['emails']['booking_email_regn_complete_text'] = array(
'#title' => t('Payment Complete Email'),
'#type' => 'textarea',
//'#format' => 'full_html',
'#description' => t('Email text to indicate a person has booked in, fully paid and is not on the waiting list. ' .
'This will be sent either at initial registration if the full amount is paid, or when the balance is paid.'),
'#default_value' => variable_get('booking_email_regn_complete_text', $booking_email_regn_complete_text),
);
$form['emails']['booking_email_waitinglist_text'] = array(
'#title' => t('Registration on Waiting List Email'),
'#description' => t('Email text to indicate a person has registered but is on the waiting list. ' .
'This will be sent instead of the Registration Successful or Registration Complete emails if the person is on the waiting list.'),
'#type' => 'textarea',
//'#format' => 'full_html',
'#default_value' => variable_get('booking_email_waitinglist_text', $booking_email_waitinglist_text),
);
$form['emails']['booking_email_partialpayment_received_text'] = array(
'#title' => t('Email text to send a person thanking them for their partial payment'),
'#type' => 'textarea',
//'#format' => 'full_html',
'#description' => t(''),
'#default_value' => variable_get('booking_email_partialpayment_received_text', ''),
);
$form['emails']['booking_email_paymentoutstanding_subject'] = array (
'#type' => 'textfield',
'#title' => t('Balance Outstanding Email Subject'),
'#description' => t('Subject line for email advising attendee they missed the payment deadline'),
'#size' => 150,
'#maxlength' => 300,
'#default_value' => variable_get('booking_email_paymentoutstanding_subject','[booking:eventname] payment required'),
);
$form['emails']['booking_email_paymentoutstanding_text'] = array(
'#description' => t('Email text to send a person reminding them of how much they owe'),
'#type' => 'textarea',
//'#format' => 'full_html',
'#title' => t('Balance Outstanding Email 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 (only applies when combined pricing enabled)'),
'#type' => 'textarea',
//'#format' => 'full_html',
'#description' => t(''),
'#default_value' => variable_get('booking_email_paymentoutstanding_married_text', $booking_email_paymentoutstanding_married_text),
);
$form['emails']['booking_email_waitinglistpromotion'] = array(
'#title' => t('Email text to send a person on the waiting list when a spot opens up for them'),
'#type' => 'textarea',
'#description' => t(''),
'#default_value' => variable_get('booking_email_waitinglistpromotion', $booking_email_waitinglistpromotion),
);
$form['emails']['booking_email_notcoming_demotion_subject'] = array (
'#type' => 'textfield',
'#title' => t('Withdrawal Processed Email'),
'#description' => t('Subject line for email advising attendee their withdrawal has been processed'),
'#size' => 150,
'#maxlength' => 300,
'#default_value' => variable_get('booking_email_notcoming_demotion_subject','[booking:eventname] withdrawal processed'),
);
$form['emails']['booking_email_notcoming_demotion'] = array(
'#title' => t('Email text to send a person who withdraws their registration'),
'#type' => 'textarea',
'#description' => t(''),
'#default_value' => variable_get('booking_email_notcoming_demotion', $booking_email_notcoming_demotion),
);
$form['emails']['booking_email_missedpayment_subject'] = array (
'#type' => 'textfield',
'#title' => t('Missed Payment Email Subject'),
'#description' => t('Subject line for email advising attendee they missed the payment deadline'),
'#size' => 150,
'#maxlength' => 300,
'#default_value' => variable_get('booking_email_missedpayment_subject','[booking:eventname] payment deadline missed'),
);
$form['emails']['booking_email_missedpayment'] = array(
'#title' => t('Missed Payment Email Text'),
'#type' => 'textarea',
'#description' => t('Email text to send a person who missed the payment deadline'),
'#default_value' => variable_get('booking_email_missedpayment', ''),
);
$form['emails']['booking_email_travel_required_subject'] = array (
'#type' => 'textfield',
'#title' => t('Travel Form Required Subject'),
'#description' => t('Subject line for email requesting attendee to complete the travel form'),
'#size' => 150,
'#maxlength' => 300,
'#default_value' => variable_get('booking_email_travel_required_subject','[booking:eventname] Travel Details Required'),
);
$form['emails']['booking_email_travel_required_text'] = array(
'#title' => t('Travel Form Required Text'),
'#description' => t('Email text requesting attendee to complete the travel form. This email will be sent from the !email email address', array('!email' => variable_get('booking_logistics_email'))),
'#type' => 'textarea',
'#default_value' => variable_get('booking_email_travel_required_text', ''),
);
$form['emails']['booking_email_travel_complete_subject'] = array (
'#type' => 'textfield',
'#title' => t('Travel Form Complete Subject'),
'#description' => t('Subject line for email indicating a person has completed the travel form'),
'#size' => 150,
'#maxlength' => 300,
'#default_value' => variable_get('booking_email_travel_complete_subject','[booking:eventname] Travel Details Received'),
);
$form['emails']['booking_email_travel_complete_text'] = array(
'#title' => t('Travel Form Complete Text'),
'#description' => t('Email text to indicate a person has completed the travel form. This email will be sent from the !email email address', array('!email' => variable_get('booking_logistics_email'))),
'#type' => 'textarea',
'#default_value' => variable_get('booking_email_travel_complete_text', ''),
);
/*Text for emails*/
$form['custom-emails'] = array(
'#type' => 'fieldset',
'#title' => 'Custom Email Text Definitions',
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
//add a bunch of custom emails
for ($i = 1; $i <= variable_get('booking_custom_email_count','5'); $i++)
{
$subject_fieldname = 'booking_email_subject_custom' . $i;
$body_fieldname = 'booking_email_custom' . $i;
$form['custom-emails'][$subject_fieldname] = array (
'#type' => 'textfield',
'#title' => t('Subject line for Custom Email ' . $i),
'#size' => 150,
'#maxlength' => 300,
'#default_value' => variable_get($subject_fieldname,'[booking:eventname]'),
);
$form['custom-emails'][$body_fieldname] = array(
'#title' => t('Email text for custom email ' . $i),
'#type' => 'textarea',
'#description' => t(''),
'#default_value' => variable_get($body_fieldname, ''),
);
}
//see http://drupal.org/node/820816#comment-3100356
//and http://drupal.org/node/823362
/*