You are here

function uc_notify_checkout_form in Ubercart 5

1 string reference to 'uc_notify_checkout_form'
uc_notify_menu in uc_notify/uc_notify.module
Implementation of hook_menu().

File

uc_notify/uc_notify.module, line 201
Handles configuration and execution of email notifications.

Code

function uc_notify_checkout_form() {
  $form['cust'] = array(
    '#type' => 'fieldset',
    '#title' => t('Customer checkout notification'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['cust']['uc_notify_cust_checkout_enabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Send order confirmation e-mails to customers after checkout.'),
    '#default_value' => variable_get('uc_notify_cust_checkout_enabled', TRUE),
  );
  $form['cust']['uc_notify_cust_checkout_subject'] = array(
    '#type' => 'textfield',
    '#title' => t('Subject'),
    '#default_value' => variable_get('uc_notify_cust_checkout_subject', t('Your Order at [store-name]')),
  );
  $form['cust']['uc_notify_cust_checkout_template'] = array(
    '#type' => 'select',
    '#title' => t('Invoice template'),
    '#description' => t('Select the invoice template to use for the e-mail.'),
    '#options' => uc_order_template_options(TRUE),
    '#default_value' => variable_get('uc_notify_cust_checkout_template', 'customer'),
  );
  $form['cust']['uc_notify_cust_checkout_custom'] = array(
    '#type' => 'textarea',
    '#title' => t('Custom template (if selected above)'),
    '#description' => l(t('Uses order and global tokens.'), 'admin/store/help/tokens'),
    '#default_value' => variable_get('uc_notify_cust_checkout_custom', ''),
    '#rows' => 5,
  );
  $form['cust']['uc_notify_cust_checkout_format'] = filter_form(variable_get('uc_notify_cust_checkout_format', 3), NULL, array(
    'uc_notify_cust_checkout_format',
  ));
  $form['admin'] = array(
    '#type' => 'fieldset',
    '#title' => t('Admin checkout notification'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['admin']['uc_notify_admin_checkout_enabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Send new order notifications to the e-mail addresses specified below.'),
    '#default_value' => variable_get('uc_notify_admin_checkout_enabled', FALSE),
  );
  $form['admin']['uc_notify_admin_checkout_subject'] = array(
    '#type' => 'textfield',
    '#title' => t('Subject'),
    '#default_value' => variable_get('uc_notify_admin_checkout_subject', t('New Order at [store-name]')),
  );
  $form['admin']['uc_notify_admin_checkout_template'] = array(
    '#type' => 'select',
    '#title' => t('Invoice template'),
    '#description' => t('Select the invoice template to use for the e-mail.'),
    '#options' => uc_order_template_options(TRUE),
    '#default_value' => variable_get('uc_notify_admin_checkout_template', 'admin'),
  );
  $form['admin']['uc_notify_admin_checkout_custom'] = array(
    '#type' => 'textarea',
    '#title' => t('Custom template (if selected above)'),
    '#description' => l(t('Uses order and global tokens.'), 'admin/store/help/tokens'),
    '#default_value' => variable_get('uc_notify_admin_checkout_custom', ''),
    '#rows' => 5,
  );
  $form['admin']['uc_notify_admin_checkout_format'] = filter_form(variable_get('uc_notify_admin_checkout_format', 3), NULL, array(
    'uc_notify_admin_checkout_format',
  ));
  $form['admin']['uc_notify_admin_checkout_emails'] = array(
    '#type' => 'textarea',
    '#title' => t('Notification recipients'),
    '#description' => t('E-mail recipients for admin order notifications, one per line.'),
    '#default_value' => variable_get('uc_notify_admin_checkout_emails', variable_get('uc_store_email', '')),
    '#rows' => 3,
  );
  return system_settings_form($form);
}