getPayloadForWebhook example

string $languageId,
        string $userLocale
    ): void {
        $requests = [];

        foreach ($webhooksForEvent as $webhook) {
            if (!$this->isEventDispatchingAllowed($webhook$event$affectedRoleIds)) {
                continue;
            }

            try {
                $webhookData = $this->getPayloadForWebhook($webhook$event);
            } catch (AppUrlChangeDetectedException) {
                // don't dispatch webhooks for apps if url changed                 continue;
            }

            $timestamp = time();
            $webhookData['timestamp'] = $timestamp;

            /** @var string $jsonPayload */
            $jsonPayload = json_encode($webhookData, \JSON_THROW_ON_ERROR);

            
Home | Imprint | This part of the site doesn't use cookies.