You are here

function newsletter_subscriber_add_mass in Newsletter 7

Menu callbacks; add subscribers (mass).

1 string reference to 'newsletter_subscriber_add_mass'
newsletter_menu in ./newsletter.module
Implements hook_menu().

File

includes/newsletter.admin.inc, line 969
Admin page callbacks for the newsletter module.

Code

function newsletter_subscriber_add_mass($form, &$form_state) {
  $lists = db_query('SELECT nlid, title FROM {newsletter_list}')
    ->fetchAllKeyed();
  $form['new'] = array(
    '#markup' => '<h3>' . t('Add Subscribers') . '</h3>',
  );
  $form['subscribers'] = array(
    '#type' => 'textarea',
    '#title' => t('Emails'),
    '#required' => TRUE,
    '#description' => t('Enter one e-mail address per line.To add additional info, use the following format using 0 or FALSE to omit a value: %format', array(
      '%format' => 'email;firstname;lastname;gender;newsletter-receive-format',
    )),
  );
  $form['list'] = array(
    '#type' => 'select',
    '#title' => t('Select lists'),
    '#options' => array_map('check_plain', $lists),
    '#required' => TRUE,
    '#multiple' => TRUE,
  );
  $form['submitnew'] = array(
    '#type' => 'submit',
    '#value' => t('Add'),
  );
  $form['cancel'] = array(
    '#type' => 'link',
    '#title' => t('Cancel'),
    '#href' => 'admin/config/media/newsletter/subscribers',
  );
  return $form;
}