Trigger Emails/Handlers on Webform submissions update Is there a way to trigger the Emails/Handlers, When webform submission has been updated. I'm using webform_mailchimp as a handler. When I'm submitting a new record, handler is working fine and  I can receive the data into my Mailchimp account. I have a function to update the submission via code. But it doesn't trigger, when I update the same record.  Following is my code to update the webform submission:

$webform = Webform::load('my_form');
$is_open = WebformSubmissionForm::isOpen($webform);
$sid = 2;

if ($is_open === TRUE) {
    // Load submission
    $webform_submission = WebformSubmission::load($sid);

    // Modify submission values
    $webform_submission-&gt;setElementData('preferred_date', $form_state-&gt;getValue('preferredDate'));
    $webform_submission-&gt;setElementData('preferred_time', $form_state-&gt;getValue('preferredTime'));

    // Validate submission.
    $errors = WebformSubmissionForm::validateWebformSubmission($webform_submission);

    // Check there are no validation errors.
    if (!empty($errors)) {
        drupal_set_message(t('Failed! Please contact the administrator.'), 'error');
    }
    else {
        // Submit values and get submission ID.
        $webform_submission = WebformSubmissionForm::submitWebformSubmission($webform_submission);
        drupal_set_message(t("Success! ".$webform_submission-&gt;id()), 'status');
    }
}



Is there a way to trigger the handler through code(programmatically)?
Is there a default configuration in the CMS?


Thanks guys,
The below code is untested but should point you in the right direction.

// Get a handler.
$webform_submission = WebformSubmission::load(WEBFORM_ID)
$handlers = $webform_submission-&gt;getWebform()-&gt;getHandlers();
$handler = $handlers[HANDLER_ID];

// Invoke submit form.
@see \Drupal\webform\Plugin\WebformHandlerInterface::submitForm
$form = []; // Might need to get the $form.
$form_state = new FormState(); // Might need to be build the form state.
$handler-&gt;submitForm($form, $form_state, $webform_submission);


@see \Drupal\webform\Entity\Webform::invokeHandlers

@see \Drupal\webform\Entity\WebformSubmission::invokeWebformHandlers