You are here

public function MessagesForm::submitForm in Swift Mailer 8

Same name and namespace in other branches
  1. 8.2 src/Form/MessagesForm.php \Drupal\swiftmailer\Form\MessagesForm::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/MessagesForm.php, line 106

Class

MessagesForm
Configuration form for SwiftMailer message settings.

Namespace

Drupal\swiftmailer\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('swiftmailer.message');
  $config
    ->set('format', $form_state
    ->getValue([
    'format',
    'type',
  ]));
  $config
    ->set('respect_format', $form_state
    ->getValue([
    'format',
    'respect',
  ]));
  $config
    ->set('convert_mode', $form_state
    ->getValue([
    'convert',
    'mode',
  ]));
  $config
    ->set('character_set', $form_state
    ->getValue([
    'character_set',
    'type',
  ]));
  $config
    ->save();
  parent::submitForm($form, $form_state);
}