diff --git a/plugins/special-actions-middle.php b/plugins/special-actions-middle.php index 9554f2a..aeff4f2 100644 --- a/plugins/special-actions-middle.php +++ b/plugins/special-actions-middle.php @@ -38,6 +38,17 @@ function saveContactData($name, $email, $address, $zip, $phone, $cooperation, $m fputcsv($csvContent, $row); } fclose($csvContent); + + // call webhook http://projectpro.dynu.net:5678/webhook-test/744ec5ad-9e7d-4a97-8391-d172c6c02eff + $webhookUrl = 'http://projectpro.dynu.net:5678/webhook/744ec5ad-9e7d-4a97-8391-d172c6c02eff'; + $data = json_encode( $contactData ); + $ch = curl_init( $webhookUrl ); + curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); + curl_setopt( $ch, CURLOPT_POST, true ); + curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json' ) ); + curl_setopt( $ch, CURLOPT_POSTFIELDS, $data ); + $response = curl_exec( $ch); + curl_close( $ch ); } if ( \S::get( 'action' ) == 'footer_contact_mail_send' and \S::get( 'token' ) == \S::get_session( 'form-token' ) and !\S::get( 'website' ) )