gravityflow_response_message_webhook

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

ParameterTypeDetails
$http_response_messageStringThe status message derived from webhook response.
$step_statusStringThe step status derived from webhook response.
$responseArrayThe response returned from webhook.
$argsArrayThe arguments used for executing the webhook request.
$entryEntryThe current entry.
$stepStepThe 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?