You are here

public function AmazonSesSettingsForm::buildForm in Amazon SES 2.0.x

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfigFormBase::buildForm

File

src/Form/AmazonSesSettingsForm.php, line 30

Class

AmazonSesSettingsForm
Amazon SES settings form.

Namespace

Drupal\amazon_ses\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('amazon_ses.settings');
  $form['from_address'] = [
    '#type' => 'email',
    '#title' => $this
      ->t('From Address'),
    '#description' => $this
      ->t('The address emails will be sent from. This
        address must be verified by SES.'),
    '#default_value' => $config
      ->get('from_address'),
    '#required' => TRUE,
  ];
  $form['throttle'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Throttle'),
    '#description' => $this
      ->t('Throttle the sending. Helpful to prevent
        exceeding the rate limit when send a high volumne of emails.'),
    '#default_value' => $config
      ->get('throttle'),
  ];
  $form['queue'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Queue emails'),
    '#description' => $this
      ->t('Emails will be placed in a queue and sent when cron runs.'),
    '#default_value' => $config
      ->get('queue'),
  ];
  return parent::buildForm($form, $form_state);
}