You are here

public function SettingsForm::submitForm in Sparkpost email 8

Same name and namespace in other branches
  1. 8.2 src/Form/SettingsForm.php \Drupal\sparkpost\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 64

Class

SettingsForm
Class SettingsForm.

Namespace

Drupal\sparkpost\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('sparkpost.settings')
    ->set('api_key', $form_state
    ->getValue('api_key'))
    ->set('sender_name', $form_state
    ->getValue('sender_name'))
    ->set('sender', $form_state
    ->getValue('sender'))
    ->save();
}