Created
July 29, 2022 20:31
-
-
Save yawalkar/8d620218d0f1fe461e0ce5638aca13e9 to your computer and use it in GitHub Desktop.
Customize the webhook response being sent to the source in FlowMattic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This filter works with FlowMattic v2.0 and above only.