You are here

function sparkpost_test_form in Sparkpost email 7.2

Same name and namespace in other branches
  1. 7 sparkpost.admin.inc \sparkpost_test_form()

Return a form for sending a test email.

1 string reference to 'sparkpost_test_form'
sparkpost_menu in ./sparkpost.module
Implements hook_menu().

File

./sparkpost.admin.inc, line 158
Admin callbacks.

Code

function sparkpost_test_form($form, &$form_state) {
  drupal_set_title(t('Send test email'));
  $form['sparkpost_test_address'] = array(
    '#type' => 'textfield',
    '#title' => t('Email address to send a test email to'),
    '#default_value' => variable_get('site_mail', ''),
    '#description' => t('Type in an address to have a test email sent there.'),
    '#required' => TRUE,
  );
  $form['sparkpost_test_body'] = array(
    '#type' => 'textarea',
    '#title' => t('Test body contents'),
    '#default_value' => t('If you receive this message it means your site is capable of using Sparkpost to send email. This url is here to test click tracking: !link', array(
      '!link' => l(t('link'), 'http://www.drupal.org/project/sparkpost'),
    )),
  );
  $form['include_attachment'] = array(
    '#title' => t('Include attachment'),
    '#type' => 'checkbox',
    '#description' => t('If checked, the Drupal icon will be included as an attachment with the test email.'),
    '#default_value' => TRUE,
  );
  $form['test_submit'] = array(
    '#type' => 'submit',
    '#value' => t('Send test email'),
  );
  $form['test_cancel'] = array(
    '#type' => 'link',
    '#href' => 'admin/config/services/sparkpost',
    '#title' => t('Cancel'),
  );
  return $form;
}