You are here

public function AnonymousPublishingClAdminEmail::submitForm in Anonymous Publishing 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

modules/anonymous_publishing_cl/src/Form/AnonymousPublishingClAdminEmail.php, line 123

Class

AnonymousPublishingClAdminEmail
This class defines the email setting form for this module, available at : admin/config/people/anonymous_publishing_cl/mail

Namespace

Drupal\anonymous_publishing_cl\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('anonymous_publishing_cl.mail');

  // Save config.
  $config
    ->set('email_subject_active', $form_state
    ->getValue('email_subject_active'));
  $config
    ->set('email_subject_verify', $form_state
    ->getValue('email_subject_verify'));
  $config
    ->set('email_introduction', $form_state
    ->getValue('email_introduction'));
  $config
    ->set('email_activate', $form_state
    ->getValue('email_activate'));
  $config
    ->set('email_verify', $form_state
    ->getValue('email_verify'));
  $config
    ->set('email_admin_subject', $form_state
    ->getValue('email_admin_subject'));
  $config
    ->set('email_admin_body', $form_state
    ->getValue('email_admin_body'));
  $config
    ->save();
  parent::submitForm($form, $form_state);
}