public function SettingsForm::submitForm in Mail Safety 8
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 67
Class
- SettingsForm
- Defines a form for the mail safety settings.
Namespace
Drupal\mail_safety\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$this
->config('mail_safety.settings')
->set('enabled', $form_state
->getValue('enabled'))
->set('send_mail_to_dashboard', $form_state
->getValue('send_mail_to_dashboard'))
->set('send_mail_to_default_mail', $form_state
->getValue('send_mail_to_default_mail'))
->set('default_mail_address', $form_state
->getValue('default_mail_address'))
->save();
parent::submitForm($form, $form_state);
}