You are here

public function SubscriptionSettingsForm::submitForm in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 src/Form/SubscriptionSettingsForm.php \Drupal\simplenews\Form\SubscriptionSettingsForm::submitForm()
  2. 8 src/Form/SubscriptionSettingsForm.php \Drupal\simplenews\Form\SubscriptionSettingsForm::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/SubscriptionSettingsForm.php, line 139

Class

SubscriptionSettingsForm
Configure simplenews subscription settings.

Namespace

Drupal\simplenews\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('simplenews.settings')
    ->set('subscription.skip_verification', $form_state
    ->getValue('simplenews_verification'))
    ->set('subscription.tidy_unconfirmed', $form_state
    ->getValue('simplenews_tidy_unconfirmed'))
    ->set('subscription.confirm_combined_subject', $form_state
    ->getValue('simplenews_confirm_combined_subject'))
    ->set('subscription.confirm_combined_body', $form_state
    ->getValue('simplenews_confirm_combined_body'))
    ->set('subscription.confirm_combined_body_unchanged', $form_state
    ->getValue('simplenews_confirm_combined_body_unchanged'))
    ->set('subscription.validate_subject', $form_state
    ->getValue('simplenews_validate_subject'))
    ->set('subscription.validate_body', $form_state
    ->getValue('simplenews_validate_body'))
    ->set('subscription.confirm_subscribe_page', $form_state
    ->getValue('simplenews_confirm_subscribe_page'))
    ->set('subscription.confirm_unsubscribe_page', $form_state
    ->getValue('simplenews_confirm_unsubscribe_page'))
    ->save();
  parent::submitForm($form, $form_state);
}