You are here

function _mailcontrol_form_submit in Mailcontrol 8

1 string reference to '_mailcontrol_form_submit'
mailcontrol_form_user_admin_settings_alter in ./mailcontrol.module
Implements hook_form_FORM_ID_alter().

File

./mailcontrol.module, line 127
This module holds functions useful for mail control.

Code

function _mailcontrol_form_submit(array $form, \Drupal\Core\Form\FormStateInterface $form_state) {
  \Drupal::service('config.factory')
    ->getEditable('user.settings')
    ->set('notify.register_admin_created', $form_state
    ->getValue('user_mail_register_admin_created_notify'))
    ->set('notify.register_pending_approval', $form_state
    ->getValue('user_mail_register_pending_approval_notify'))
    ->set('notify.register_no_approval_required', $form_state
    ->getValue('user_mail_register_no_approval_required_notify'))
    ->set('notify.cancel_confirm', $form_state
    ->getValue('user_mail_cancel_confirm_notify'))
    ->set('notify.password_reset', $form_state
    ->getValue('user_mail_password_reset_notify'))
    ->save();
}