public function onAfterDispatchWebhook(object $response, object $hook) : void

Fires after transmitting the payload to the web hook.


Description

Plugins can use this filter to manipulate the response received after deploying the web hook.


Parameters

$response

(object)  The HTTP response holding the following properties:

  • code - the HTTP status code;
  • headers - an associative array containing the headers received by the server;
  • body - the response received by the server.
$hook

(object)  An object holding the web hook details, such as the notified URL and a secret key.

Return Value

None.


Example

/**
 * Plugins can use this event to manipulate the response received after
 * deploying the web hook.
 *
 * @param   object  $response  The HTTP response object.
 * @param   object  $hook      The web hook details.
 *
 * @return  void
 */
public function onAfterDispatchWebhook($response, $hook)
{
    /**
     * @todo any changes applied to $response will be automatically saved into the log file
     */
}

Changelog

VersionDescription
1.7 Introduced.
Last Update: 2021-10-08 16:26
Helpful?