You are here

public function MessagesForm::submitForm in Swift Mailer 8.2

Same name and namespace in other branches
  1. 8 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 122

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('content_type', $form_state
    ->getValue([
    'content_type',
    'type',
  ]));
  $config
    ->set('text_format', $form_state
    ->getValue([
    'html_convert',
    'format',
  ]));
  $config
    ->set('generate_plain', $form_state
    ->getValue([
    'generate_plain',
    'mode',
  ]));
  $config
    ->set('character_set', $form_state
    ->getValue([
    'character_set',
    'type',
  ]));
  $config
    ->save();
  parent::submitForm($form, $form_state);
}