gravityflow_webhook_args

The gravityflow_webhook_args filter allow the webhook to be modified before it's sent.

Example:

add_filter( 'gravityflow_webhook_args', 'sh_filter_gravityflow_webhook_args', 10, 3 );
function sh_filter_gravityflow_webhook_args( $args, $entry, $current_step ) {
	// POST only the value of field 2 with a custom key
	if ( $args['method'] == 'POST' ) {
		$args['body'] = array( 'my_value' => $entry['2'] );
	}
	return $args;
}

Example of basic authentication using username and password:

add_filter( 'gravityflow_webhook_args', 'sh_filter_gravityflow_webhook_args', 10, 3 );
function sh_filter_gravityflow_webhook_args( $args, $entry, $current_step ) {
	$args['headers'] = array(
            'Authorization' => 'Basic ' . base64_encode( YOUR_USERNAME . ':' . YOUR_PASSWORD )
       );

    return $args;
}

Placement

This code should be placed in the functions.php file of your active theme.

Still need help? Contact Support Contact Support