Description
The gravityflow_response_message_webhook filter allow the status message for the outgoing webhook step to be modified before it is added to the timeline (displayed at bottom of entry details via the inbox or status pages). The initial value of the message indicates the HTTP response code, message and the corresponding status of the step, such as “204 No Content (Success)”
If you want to change the step status along with the message, you will also need to filter gravityflow_step_status_webhook.
Parameters
Parameter | Type | Details |
---|---|---|
$http_response_message | String | The status message derived from webhook response. |
$step_status | String | The step status derived from webhook response. |
$response | Array | The response returned from webhook. |
$args | Array | The arguments used for executing the webhook request. |
$entry | Entry | The current entry. |
$step | Step | The current step. |
Examples
Append the request JSON body to the response message (for timeline)
1 2 3 4 5 | add_filter( 'gravityflow_response_message_webhook' , 'sh_filter_gravityflow_response_message_webhook' , 10, 6 ); function sh_filter_gravityflow_response_message_webhook( $http_response_message , $step_status , $response , $args , $entry , $step ) { $http_response_message .= $args [ 'body' ]; return $http_response_message ; } |
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?