You are here

public function ScheduleEmailWebformHandler::submitConfigurationForm in Webform 8.5

Same name and namespace in other branches
  1. 6.x modules/webform_scheduled_email/src/Plugin/WebformHandler/ScheduleEmailWebformHandler.php \Drupal\webform_scheduled_email\Plugin\WebformHandler\ScheduleEmailWebformHandler::submitConfigurationForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().

Overrides EmailWebformHandler::submitConfigurationForm

File

modules/webform_scheduled_email/src/Plugin/WebformHandler/ScheduleEmailWebformHandler.php, line 315

Class

ScheduleEmailWebformHandler
Schedules a webform submission's email.

Namespace

Drupal\webform_scheduled_email\Plugin\WebformHandler

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  parent::submitConfigurationForm($form, $form_state);
  if ($form_state
    ->getValue('queue')) {

    /** @var \Drupal\webform_scheduled_email\WebformScheduledEmailManagerInterface $webform_scheduled_email_manager */
    $webform_scheduled_email_manager = \Drupal::service('webform_scheduled_email.manager');
    $webform_scheduled_email_manager
      ->schedule($this
      ->getWebform(), $this
      ->getHandlerId());
  }
}