posted_data ) && class_exists( 'WPCF7_Submission' ) ) { $submission = WPCF7_Submission::get_instance(); if ( $submission ) { $formdata = $submission->get_posted_data(); $url = "https://api.ascora.com.au/Enquiry"; $token = 'YOUR_TOKEN_HERE'; $headers = array(); $headers['Auth'] = $token; $headers['Content-type'] = 'application/json'; $body = array(); $body['companyName'] = ""; $body['firstName'] = $formdata['First']; $body['lastName'] = $formdata['Last']; $body['email'] = $formdata['Email']; $body['phone'] = $formdata['Telephone']; $body['mobile'] = ""; $body['addressLine1'] = ""; $body['addressLine2'] = ""; $body['addressSuburb'] = ""; $body['addressState'] = ""; $body['addressPostcode'] = $formdata['Postcode']; $body['addressCountry'] = ""; $body['enquiryDescription'] = $formdata['Message']; $reponse = wp_remote_post( $url, array( 'headers' => $headers, 'body' => json_encode( $body ), 'timeout' => 120 ) ); } } } } } new Contact_Form_7_Ascora();