You are here

function regcode_mailer_mail_action_form in Registration codes 7

Same name and namespace in other branches
  1. 6.2 regcode_mailer/regcode_mailer.module \regcode_mailer_mail_action_form()
  2. 7.2 regcode_mailer/regcode_mailer.module \regcode_mailer_mail_action_form()

Form for the mail action.

File

regcode_mailer/regcode_mailer.module, line 26
Main code functionality and hooks of regcode_mailer module.

Code

function regcode_mailer_mail_action_form() {
  $form = array();
  $form['regcode_mailer_subject'] = array(
    '#type' => 'textfield',
    '#title' => t('Subject'),
    '#required' => TRUE,
  );
  $form['regcode_mailer_message'] = array(
    '#type' => 'textarea',
    '#title' => t('Body'),
    '#description' => t('Enter the plaintext email to be sent to the user.'),
    '#rows' => 8,
    '#required' => TRUE,
  );
  $form['regcode_mailer_tokens'] = array(
    '#title' => t('Replacement patterns'),
    '#type' => 'fieldset',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['regcode_mailer_tokens']['token_tree'] = array(
    '#theme' => 'token_tree',
    '#token_types' => array(
      'regcode',
    ),
  );
  $form['regcode_mailer_emails'] = array(
    '#type' => 'textarea',
    '#title' => t('Email addresses'),
    '#description' => t('List the email addresses to send the registration code to. Separate each email with a new line.'),
    '#rows' => 8,
    '#required' => TRUE,
  );
  $form['regcode_mailer_tags'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Tags'),
    '#options' => regcode_get_vocab_terms(),
    '#description' => t('You may assign tags to track which codes have been sent.'),
  );
  return $form;
}