false, "error" => "Webhook not configured", "detail" => null, ]; } $nameSafe = cc_safe_text($name); $emailSafe = cc_safe_text($email); $raw = trim($message); $rawLen = cc_strlen($raw); $maxDesc = 4096; if ($rawLen > $maxDesc) { $raw = cc_substr($raw, 0, $maxDesc - 25) . "\n\n[... truncated ...]"; } $desc = ">>> " . cc_safe_text($raw); // Get client IP address - compatible with both PHP 7.4 and 8.x if (!empty($_SERVER["HTTP_CF_CONNECTING_IP"])) { $ip = $_SERVER["HTTP_CF_CONNECTING_IP"]; } elseif (!empty($_SERVER["HTTP_X_FORWARDED_FOR"])) { $ip = $_SERVER["HTTP_X_FORWARDED_FOR"]; } elseif (!empty($_SERVER["REMOTE_ADDR"])) { $ip = $_SERVER["REMOTE_ADDR"]; } else { $ip = "Unknown"; } if (strpos($ip, ",") !== false) { $ip = trim(explode(",", $ip)[0]); } // Get user agent $ua = cc_substr( cc_safe_text(!empty($_SERVER["HTTP_USER_AGENT"]) ? $_SERVER["HTTP_USER_AGENT"] : "Unknown"), 0, 900, ); // Determine protocol - compatible with both PHP 7.4 and 8.x $scheme = (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] !== "off") ? "https://" : "http://"; $host = !empty($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : "localhost"; $uri = strtok(!empty($_SERVER["REQUEST_URI"]) ? $_SERVER["REQUEST_URI"] : "/", "?"); $url = $scheme . $host . $uri; // Build simple plain text payload for Discord (no embed) $baseContent = "**New Contact Submission**\n" . "Name: {$nameSafe}\n" . "Email: {$emailSafe}\n" . "URL: {$url}\n" . "Message:\n"; $room = 2000 - strlen($baseContent); if ($room < 0) { $room = 0; } if (strlen($raw) > $room) { $rawDisplay = substr($raw, 0, max(0, $room - 15)) . "\n[...truncated]"; } else { $rawDisplay = $raw; } $payload = [ "content" => $baseContent . $rawDisplay, "allowed_mentions" => ["parse" => []], ]; $json = cc_json_encode($payload); $status = null; $detail = null; if (function_exists("curl_init")) { $ch = @curl_init($webhook_url); if (!$ch) { $detail = "Cannot init cURL"; } else { curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_HTTPHEADER => ["Content-Type: application/json"], CURLOPT_POSTFIELDS => $json, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 8, ]); $resp = curl_exec($ch); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($resp === false) { $detail = "cURL: " . curl_error($ch); } elseif ($status < 200 || $status >= 300) { $detail = "HTTP $status: $resp"; } curl_close($ch); } } else { $ctx = stream_context_create([ "http" => [ "method" => "POST", "header" => "Content-Type: application/json\r\n", "content" => $json, "timeout" => 8, ], ]); // Error handling improved for PHP 7.4 compatibility $resp = @file_get_contents($webhook_url, false, $ctx); $status = null; // Parse response headers safely if (!empty($http_response_header) && is_array($http_response_header)) { foreach ($http_response_header as $h) { if (!is_string($h)) continue; if (preg_match("#HTTP/\\S+\\s+(\\d{3})#", $h, $m)) { $status = (int) $m[1]; break; } } } if ($resp === false || ($status !== null && ($status < 200 || $status >= 300))) { $detail = "Stream send failed (HTTP " . ($status !== null ? $status : "??") . ")"; } } if ($detail) { error_log("[DiscordWebhook] " . $detail); return [ "ok" => false, "error" => "Discord send failed", "detail" => $detail, ]; } return ["ok" => true, "error" => null, "detail" => null]; } /* --- Handle POST --- */ if ( $_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST["contact_token"]) && empty($_POST["website"]) ) { // Form processing compatible with both PHP 7.4 and 8.x $name = trim(!empty($_POST["name"]) ? $_POST["name"] : ""); $email = trim(!empty($_POST["email"]) ? $_POST["email"] : ""); $message = trim(!empty($_POST["message"]) ? $_POST["message"] : ""); if ( $name !== "" && filter_var($email, FILTER_VALIDATE_EMAIL) && $message !== "" ) { $contact_success = true; cc_send_discord_contact($name, $email, $message); } else { $contact_error = "Please provide a valid name, email, and message."; } } ?> Clay Consulting - Driving Innovation, Delivering Value.

Driving Innovation, Delivering Value.

Positioning organizations for tomorrow through scalable, synergistic, cross-functional excellence.

About Us

At Clay Consulting, we leverage cutting-edge strategies to empower businesses across diverse sectors. Harnessing a culture of continuous improvement, we synchronize transformative roadmaps with scalable operational rigor.

Our mission is to deliver scalable solutions that align with tomorrow’s challenges. Through an integrated focus on stakeholder alignment, value acceleration, and enterprise resilience, we enable organizations to convert strategic intent into measurable outcomes.

We orchestrate innovation by embedding data-driven optionality within core processes, ensuring sustainable differentiation and end-to-end lifecycle performance across global value chains.

“Their framework empowered us to pivot, optimize, and accelerate our multi-market engagement model with unparalleled clarity and speed.”
— Customer Testimonial
Core Pillars
  • Strategic Enablement
  • Resilient Scalability
  • Operational Alignment
  • Insight Optimization

Services

We provide a broad matrix of capability layers engineered to unlock latent enterprise potential and drive multidimensional value capture.

BCBusiness Consulting

Strategic frameworks and holistic advisory aligning vision with scalable execution across global delivery channels.

DTDigital Transformation

End-to-end modernization blueprints catalyzing platform agility, omnichannel integration, and adaptive governance.

CICloud Integration

Composable cloud migration and interoperability pathways optimizing elasticity and workload orchestration.

ESEnterprise Solutions

Modular architectures unifying stakeholder ecosystems through scalable, service-driven operating layers.

DDData-Driven Insights

Analytics amplification converting fragmented datasets into predictive intelligence and actionable levers.

VXValue Expansion

Portfolio rationalization and continuous improvement loops reinforcing sustainable ROI horizons.

Case Studies & Clients

We have supported Fortune 500 companies in achieving operational efficiency and worked with global partners to streamline innovation pipelines.

Operational Efficiency Enablement

Delivered a layered maturity model accelerating cross-silo transparency and compressing decision latency.

Fortune 500 | Global Footprint

Innovation Pipeline Streamlining

Unified prototype gating process with governance telemetry, amplifying throughput and reducing redundancy.

International Consortium

Cloud-Native Adoption Catalyst

Architected microservice modularity enabling horizontal scale and improving release velocity.

Enterprise Technology Sector

Lifecycle Analytics Fabric

Implemented an insight fabric translating real-time signals into proactive intervention scenarios.

Industrial Vertical

Global Integration Alignment

Harmonized multi-region platforms under a unifying interoperability schema.

Multinational Portfolio

Strategic Resilience Roadmap

Developed resilience indices enabling adaptive risk recalibration and continuity acceleration.

Corporate Advisory

Careers

Join Our Growing Team

We are always seeking talented professionals to join our growing team. If you are passionate about enabling enterprise transformation and shaping scalable value creation, we invite you to express interest.

Submit Resume

Contact Us

Ready to explore alignment opportunities? Reach out via the form below.

General Inquiries

For engagements, partnerships, or additional information, contact us using the form.

We respond to legitimate business inquiries in a timely manner.

Thank you — your message has been received.
(Note: )
">