Skip to content

Instantly share code, notes, and snippets.

@yawalkar
Created July 29, 2022 20:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yawalkar/8d620218d0f1fe461e0ce5638aca13e9 to your computer and use it in GitHub Desktop.
Save yawalkar/8d620218d0f1fe461e0ce5638aca13e9 to your computer and use it in GitHub Desktop.
Customize the webhook response being sent to the source in FlowMattic
<?php
/**
* Alter the response sent from webhook to the source.
*
* @param array $response Original response being sent to the source.
* @param string $workflow_id The workflow ID.
* @param array $capture_data Data captured in the webhook.
*
* @return array
*/
function manage_flowmattic_webhook_response( $response, $workflow_id, $capture_data ) {
// Check your workflow ID.
if ( 'aAbBCc01234' === $workflow_id ) {
$response = 'OK';
}
return $response;
}
add_filter( 'flowmattic_webhook_response', 'manage_flowmattic_webhook_response', 10, 3 );
@yawalkar
Copy link
Author

This filter works with FlowMattic v2.0 and above only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment