You are here

function amazon_ses_admin_settings in Amazon SES 6

Administrative settings.

Return value

An array containing form items to place on the module settings page.

1 call to amazon_ses_admin_settings()
amazon_ses_mailengine in ./amazon_ses.module
Implementation of hook_mailengine().
1 string reference to 'amazon_ses_admin_settings'
amazon_ses_menu in ./amazon_ses.module
Implementation of hook_menu().

File

./amazon_ses.admin.inc, line 14
Administrative forms for Amazon SES module.

Code

function amazon_ses_admin_settings() {
  $form = array();
  $form['aws-info'] = array(
    '#type' => 'fieldset',
    '#title' => t('AWS Information'),
  );
  $form['aws-info']['info'] = array(
    '#value' => amazon_ses_admin_info(),
  );
  $form['onoff'] = array(
    '#type' => 'fieldset',
    '#title' => t('Install options'),
  );
  $form['onoff']['amazon_ses_on'] = array(
    '#type' => 'radios',
    '#title' => t('Turn this module on or off'),
    '#default_value' => variable_get('amazon_ses_on', 0),
    '#options' => array(
      1 => t('On'),
      0 => t('Off'),
    ),
    '#description' => t('To uninstall this module you must turn it off here first.'),
  );
  $form['onoff']['amazon_ses_debugging'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable debugging'),
    '#default_value' => variable_get('amazon_ses_debugging', 0),
    '#description' => t('Checking this box will print Amazon SES messages from the server for every email that is sent.'),
  );
  $form['email_options'] = array(
    '#type' => 'fieldset',
    '#title' => t('Email options'),
  );
  $form['email_options']['amazon_ses_from'] = array(
    '#type' => 'select',
    '#title' => t('Email from address'),
    '#default_value' => variable_get('amazon_ses_from', ''),
    '#description' => t('Select a verified email address. All email will be sent as this address.'),
    '#options' => amazon_ses_verified_addresses(),
  );
  $form['email_options']['amazon_ses_from_new'] = array(
    '#type' => 'fieldset',
    '#title' => t('Verify a new email address'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['email_options']['amazon_ses_from_new']['new_address'] = array(
    '#type' => 'textfield',
    '#title' => 'New Email address',
  );
  $form['email_options']['amazon_ses_from_new']['new_address_submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
    '#submit' => array(
      'amazon_ses_admin_new_address_submit',
    ),
  );
  $formats = filter_formats();
  $options = array();
  foreach ($formats as $v => $format) {
    $options[$v] = $format->name;
  }
  $form['email_options']['amazon_ses_filter_format'] = array(
    '#type' => 'select',
    '#title' => t('Input format'),
    '#description' => t('Email bodies must be converted to HTML prior to sending. Please select an Input Format to use. Full HTML recommended.'),
    '#options' => $options,
    '#default_value' => array(
      variable_get('amazon_ses_filter_format', 2),
    ),
  );
  $form['email_test'] = array(
    '#type' => 'fieldset',
    '#title' => t('Send test email'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['email_test']['amazon_ses_test_address'] = array(
    '#type' => 'textfield',
    '#title' => t('Email address to send a test email to'),
    '#default_value' => '',
    '#description' => t('Type in an address to have a test email sent there.'),
  );
  $form['email_test']['amazon_ses_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 Amazon SES to send email.'),
  );
  $form['#submit'][] = 'amazon_ses_admin_settings_submit';
  return system_settings_form($form);
}