public function WebhooksTestSubscriber::onWebhookSend in Webhooks 8
Webhook send event handler.
Parameters
\Drupal\webhooks\Event\SendEvent $event: Response event.
File
- tests/
modules/ webhooks_test/ src/ EventSubscriber/ WebhooksTestSubscriber.php, line 50
Class
- WebhooksTestSubscriber
- Webhooks Test event subscriber.
Namespace
Drupal\webhooks_test\EventSubscriberCode
public function onWebhookSend(SendEvent $event) {
$this->state
->set(__FUNCTION__, TRUE);
$webhook = $event
->getWebhook();
$webhook_config = $event
->getWebhookConfig();
$this->state
->set(__FUNCTION__ . '_webhook', $webhook);
$this->state
->set(__FUNCTION__ . '_webhook_config', $webhook_config);
$this->messenger
->addStatus(print_r($webhook_config, TRUE));
$this->messenger
->addStatus(print_r($webhook, TRUE));
}