$message_sent = false; if ($_SERVER["REQUEST_METHOD"] == "POST") { // 1. GENERATE COLLISION-PROOF ID $unique_hash = substr(uniqid('', true), -5); $job_id = "MSG-" . date("y") . "-" . $unique_hash; // 2. PAYLOAD $payload = [ "source" => "Form_General_Contact", "timestamp" => date("c"), "job_id" => $job_id, "client" => [ "name" => filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING), "email" => filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL), "phone" => filter_input(INPUT_POST, 'phone', FILTER_SANITIZE_STRING), ], "details" => [ "notes" => filter_input(INPUT_POST, 'message', FILTER_SANITIZE_STRING), ] ]; // 3. SEND TO BRAIN API (if configured) if (strpos($webhook_url, "cariswest") !== false) { $ch = curl_init($webhook_url); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload)); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch); $message_sent = true; } } ?> Contact Us | Caris Group West

Contact Us

Get in touch with our inspection team

Message Sent Successfully!

Thank you for reaching out. We'll get back to you within 24 hours.

Reference:

Call Us

(360) 519-5959

Location

Port Townsend, WA