You are here

function casetracker_mail_settings in Case Tracker 5

Configures the various Case Tracker mail options; system_settings_form().

1 string reference to 'casetracker_mail_settings'
casetracker_mail_menu in ./casetracker_mail.module
Implementation of hook_menu().

File

./casetracker_mail.module, line 243
Enables mail sending and Mailhandler integration for Case Tracker.

Code

function casetracker_mail_settings() {
  $form = array();
  $form['casetracker_mail'] = array(
    '#type' => 'fieldset',
    '#title' => t('E-mail settings'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
    '#description' => t('Enter the From address, subject, case message, and comment message for Case Tracker generated mails. Available variables are %project_id (the node ID), %project_number, %project_title, %case_id (the node ID), %case_number, %case_title.'),
  );
  $form['casetracker_mail']['casetracker_mail_address'] = array(
    '#type' => 'textfield',
    '#title' => t('E-mail address'),
    '#default_value' => variable_get('casetracker_mail_address', variable_get('site_mail', ini_get('sendmail_from'))),
    '#description' => t('A valid e-mail address used in the From: of all Case Tracker generated mails.'),
  );
  $form['casetracker_mail']['casetracker_mail_subject'] = array(
    '#type' => 'textfield',
    '#title' => t('Subject'),
    '#default_value' => variable_get('casetracker_mail_subject', _casetracker_mail_subject()),
    '#description' => t('Enter the subject of all Case Tracker generated mails.'),
  );
  $form['casetracker_mail']['casetracker_mail_case_message'] = array(
    '#rows' => 15,
    '#type' => 'textarea',
    '#title' => t('Case message'),
    '#default_value' => variable_get('casetracker_mail_case_message', _casetracker_mail_case_message()),
    '#description' => t('Enter the case message body of Case Tracker generated mails. Apart from the variables mentioned above, additional variables include %case_type, %case_priority, %case_status, %case_assigned, %case_author, %case_created, %case_changed, %case_url, %case_description, %comment (see below for the value of the %comment variable).'),
  );

  // @todo it is not exactly clear how CCK node types (or other custom node fields) will be available as %variables.
  // @todo it also doesn't appear like we can give a list of all other comments made on this particular case.
  $form['casetracker_mail']['casetracker_mail_comment_message'] = array(
    '#rows' => 10,
    '#type' => 'textarea',
    '#title' => t('Comment message'),
    '#default_value' => variable_get('casetracker_mail_comment_message', _casetracker_mail_comment_message()),
    '#description' => t('Enter the comment message body of Case Tracker generated mails. The %comment variable in the \'Case message\' text above will be replaced by this value (if applicable). Available additional variables are %comment_author, %comment_title, %comment_description.'),
  );
  return system_settings_form($form);
}