You are here

public function MailchimpListsSubscribeForm::submitForm in Mailchimp 2.x

Same name and namespace in other branches
  1. 8 modules/mailchimp_lists/src/Form/MailchimpListsSubscribeForm.php \Drupal\mailchimp_lists\Form\MailchimpListsSubscribeForm::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 FormInterface::submitForm

File

modules/mailchimp_lists/src/Form/MailchimpListsSubscribeForm.php, line 165

Class

MailchimpListsSubscribeForm
Subscribe to a Mailchimp list/audience.

Namespace

Drupal\mailchimp_lists\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $wrapper_key = $form_state
    ->getValue('wrapper_key');
  $choices = $form_state
    ->getValue($wrapper_key);
  mailchimp_lists_process_subscribe_form_choices($choices, $this->fieldInstance, $this->fieldInstance
    ->getEntity());
}