move custom emails to their own page
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
<?php
|
||||
|
||||
function booking_emails_admin() {
|
||||
/**
|
||||
* Function to allow admin user to define contents of workflow emails that can be sent by Bookings module
|
||||
*
|
||||
* @param
|
||||
* @return form render array
|
||||
*/
|
||||
function booking_emails_workflow_admin() {
|
||||
global $event;
|
||||
$form = array();
|
||||
//some initial workflow email definitions
|
||||
@@ -225,6 +231,7 @@ function booking_emails_admin() {
|
||||
);
|
||||
|
||||
/*Text for emails*/
|
||||
/*
|
||||
$form['custom-emails'] = array(
|
||||
'#type' => 'fieldset',
|
||||
'#title' => 'Custom Email Text Definitions',
|
||||
@@ -251,6 +258,7 @@ function booking_emails_admin() {
|
||||
'#format' => $form_format,
|
||||
);
|
||||
}
|
||||
*/
|
||||
|
||||
/*Text for logistics emails*/
|
||||
$form['custom-logistics-emails'] = array(
|
||||
@@ -285,6 +293,60 @@ function booking_emails_admin() {
|
||||
return system_settings_form($form, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to allow admin user to define custom emails that can be sent by Bookings module
|
||||
*
|
||||
* @param
|
||||
* @return form render array
|
||||
*/
|
||||
function booking_emails_custom_admin() {
|
||||
global $event;
|
||||
$form = array();
|
||||
|
||||
if(variable_get('booking_enable_html_mail', 0) == 1) {
|
||||
$form_type = 'text_format';
|
||||
$form_format = 'full_html';
|
||||
}
|
||||
else {
|
||||
$form_type = 'textarea';
|
||||
$form_format = NULL;
|
||||
}
|
||||
|
||||
//include the token definitions
|
||||
$form['tokens'] = array(
|
||||
'#theme' => 'token_tree',
|
||||
'#token_types' => array('booking'),
|
||||
);
|
||||
|
||||
/*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),
|
||||
'#description' => t(''),
|
||||
'#default_value' => isset(variable_get($body_fieldname)['value']) ? variable_get($body_fieldname)['value'] : variable_get($body_fieldname, ''),
|
||||
'#type' => $form_type,
|
||||
'#format' => $form_format,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to allow admin user to manually generate and send a workflow or custom email
|
||||
*
|
||||
|
@@ -190,7 +190,7 @@ function booking_menu() {
|
||||
'title' => 'Booking module workflow email definitions',
|
||||
'description' => 'Configure built-in workflow emails used by the Booking module',
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('booking_emails_admin'),
|
||||
'page arguments' => array('booking_emails_workflow_admin'),
|
||||
'access arguments' => array('access administration pages'),
|
||||
'file' => 'booking.emails_admin.inc',
|
||||
'weight' => -98,
|
||||
@@ -199,7 +199,8 @@ function booking_menu() {
|
||||
$items['admin/config/booking/emails/custom'] = array(
|
||||
'title' => 'Booking module custom email definitions',
|
||||
'description' => 'Configure custom emails used by the Booking module',
|
||||
'page callback' => 'booking_emails_admin',
|
||||
'page callback' => 'drupal_get_form',
|
||||
'page arguments' => array('booking_emails_custom_admin'),
|
||||
'access arguments' => array('access administration pages'),
|
||||
'file' => 'booking.emails_admin.inc',
|
||||
'type' => MENU_LOCAL_ACTION,
|
||||
|
Reference in New Issue
Block a user