You are here

public function SettingsForm::submitForm in Reroute Email 8

Same name and namespace in other branches
  1. 2.x src/Form/SettingsForm.php \Drupal\reroute_email\Form\SettingsForm::submitForm()

Form submission handler.

Parameters

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

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

Overrides ConfigFormBase::submitForm

File

src/Form/SettingsForm.php, line 203

Class

SettingsForm
Implements a settings form for Reroute Email configuration.

Namespace

Drupal\reroute_email\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->rerouteConfig
    ->set(REROUTE_EMAIL_ENABLE, $form_state
    ->getValue(REROUTE_EMAIL_ENABLE))
    ->set(REROUTE_EMAIL_ADDRESS, $form_state
    ->getValue(REROUTE_EMAIL_ADDRESS))
    ->set(REROUTE_EMAIL_WHITELIST, $form_state
    ->getValue(REROUTE_EMAIL_WHITELIST))
    ->set(REROUTE_EMAIL_DESCRIPTION, $form_state
    ->getValue(REROUTE_EMAIL_DESCRIPTION))
    ->set(REROUTE_EMAIL_MESSAGE, $form_state
    ->getValue(REROUTE_EMAIL_MESSAGE))
    ->set(REROUTE_EMAIL_MAILKEYS, $form_state
    ->getValue(REROUTE_EMAIL_MAILKEYS))
    ->save();
  parent::submitForm($form, $form_state);
}