Created
May 27, 2020 10:01
-
-
Save stevenroh/ba7063e0932c8b2c8b28bf8f9e0ff5a7 to your computer and use it in GitHub Desktop.
Custom slack_wpcf7_submit_message
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 | |
/* $message — Default message to send to Slack | |
$form — Form object | |
$result — Array of result | |
*/ | |
function custom_cf_7( $message, $form, $result ) { | |
return "OK" . json_encode($form) . json_encode($result); // Customize message here | |
} | |
add_filter( 'slack_wpcf7_submit_message', 'custom_cf_7', 10, 3 ); | |
/* Outputs this : | |
OK{}{"contact_form_id":6,"status":"mail_sent","message":"Thank you for your message. It has been sent.","demo_mode":false} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment