test
This commit is contained in:
@@ -35,6 +35,17 @@ function booking_admin() {
|
||||
'#collapsible' => TRUE,
|
||||
);
|
||||
|
||||
$form['features']['booking_enable_html_mail'] = array(
|
||||
'#type' => 'radios',
|
||||
'#title' => t('Enable html emails?'),
|
||||
'#description' => t('Turn this feature on for html based emails, otherwise plaintext emails will be used. HTML based emails will require a custom template file to be defined.'),
|
||||
'#options' => array(
|
||||
0 => t('No'),
|
||||
t('Yes')
|
||||
),
|
||||
'#default_value' => variable_get('booking_enable_html_mail', 0)
|
||||
);
|
||||
|
||||
$form['email']['booking_from_email'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t('Sender Email Address'),
|
||||
|
@@ -48,6 +48,18 @@ function booking_emails_admin() {
|
||||
$booking_email_notcoming_demotion = "";
|
||||
$booking_email_paymentoutstanding_married_text = "";
|
||||
|
||||
if(variable_get('booking_enable_html_mail', 0) == 1) {
|
||||
$textarea_defaults = array(
|
||||
'#type' => 'text_format',
|
||||
'#format' => 'full_html',
|
||||
);
|
||||
}
|
||||
else {
|
||||
$textarea_defaults = array(
|
||||
'#type' => 'textarea',
|
||||
);
|
||||
}
|
||||
|
||||
//include the token definitions
|
||||
$form['tokens'] = array(
|
||||
'#theme' => 'token_tree',
|
||||
@@ -70,12 +82,10 @@ function booking_emails_admin() {
|
||||
);
|
||||
$form['emails']['booking_email_bookedin_text'] = array(
|
||||
'#title' => t('Registration Successful Email'),
|
||||
//'#type' => 'textarea',
|
||||
'#type' => 'text_format',
|
||||
'#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_bookedin_text'][] = $textarea_defaults;
|
||||
$form['emails']['booking_email_regn_complete_text'] = array(
|
||||
'#title' => t('Payment Complete Email'),
|
||||
'#type' => 'textarea',
|
||||
|
@@ -651,6 +651,15 @@ function booking_update_7242() {
|
||||
_booking_node_create_mysqlview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add support for html emails
|
||||
*/
|
||||
function booking_update_7243() {
|
||||
$current = variable_get('mail_system', array('default-system' => 'DefaultMailSystem'));
|
||||
$addition = array('booking' => 'BookingMailSystem');
|
||||
variable_set('mail_system', array_merge($current, $addition));
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of hook_install().
|
||||
*/
|
||||
@@ -692,6 +701,7 @@ function booking_uninstall() {
|
||||
|
||||
/**
|
||||
* Implement hook_enable()
|
||||
* Based on https://drupal.stackexchange.com/questions/23821/email-a-whole-node-including-template-contents
|
||||
*/
|
||||
function booking_enable() {
|
||||
drupal_set_message($message = t('The Booking System module was successfully enabled.'), $type = 'status');
|
||||
|
Reference in New Issue
Block a user