Skip to content

Instantly share code, notes, and snippets.

@stevenroh
Created May 27, 2020 10:01
Show Gist options
  • Save stevenroh/ba7063e0932c8b2c8b28bf8f9e0ff5a7 to your computer and use it in GitHub Desktop.
Save stevenroh/ba7063e0932c8b2c8b28bf8f9e0ff5a7 to your computer and use it in GitHub Desktop.
Custom slack_wpcf7_submit_message
<?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