You are here

function newsletter_create_send_form_page_two in Newsletter 7

1 call to newsletter_create_send_form_page_two()
newsletter_create_send in includes/newsletter.admin.inc
Menu callback; multistep form to create and send a custom newsletter.

File

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

Code

function newsletter_create_send_form_page_two($form, &$form_state) {
  $data = newsletter_create($form_state['values']['list'], $form_state['values']['template'])
    ->preview();
  $form['newsletter'] = array(
    '#type' => 'item',
    '#description' => '<strong>' . t('Please bare in mind that any change here will affect the template directly') . '</strong>',
  );
  $form['newsletter']['subject'] = array(
    '#type' => 'textfield',
    '#title' => t('Subject'),
    '#value' => check_plain($data['subject']),
  );
  $form['newsletter']['body'] = array(
    '#type' => 'text_format',
    '#title' => t('Body'),
    '#value' => $data['body'],
    '#format' => $data['body_format'],
  );
  $form['test-email'] = array(
    '#type' => 'textfield',
    '#title' => t('E-mail to send test mail to'),
    '#description' => t('Leave this empty to use the site e-mail address'),
  );
  $form['send'] = array(
    '#type' => 'submit',
    '#value' => t('Send newsletter now'),
    '#submit' => array(
      'newsletter_create_send_form_page_two_submit',
    ),
  );
  $form['send-test'] = array(
    '#type' => 'submit',
    '#value' => t('Send test e-mail first to address above'),
    '#submit' => array(
      'newsletter_create_send_form_page_two_submit',
    ),
  );
  $form['cancel'] = array(
    '#type' => 'link',
    '#title' => t('Cancel'),
    '#href' => 'admin/config/media/newsletter/create-send',
  );
  return $form;
}