You are here

public function ContentHubSettingsForm::removeWebhookSuppression in Acquia Content Hub 8.2

Remove webhook suppression.

Parameters

array $form: The form.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

Throws

\Exception

File

src/Form/ContentHubSettingsForm.php, line 559

Class

ContentHubSettingsForm
Defines the form to configure the Content Hub connection settings.

Namespace

Drupal\acquia_contenthub\Form

Code

public function removeWebhookSuppression(array &$form, FormStateInterface $form_state) : void {
  $webhook_uuid = $this->settings
    ->getWebhook('uuid');
  $success = $this->chConnectionManager
    ->removeWebhookSuppression($webhook_uuid);
  if (!$success) {
    $this
      ->messenger()
      ->addError($this
      ->t('Cannot register with env vars, please check your log messages.'));
  }
  $this
    ->config('acquia_contenthub.admin_settings')
    ->set('is_suppressed', FALSE)
    ->save();
  $this
    ->messenger()
    ->addMessage($this
    ->t('Registering ACH was successful.'));
}