'Method not allowed']); exit; } $data = json_decode(file_get_contents('php://input'), true); if (!$data || !isset($data['phone'])) { http_response_code(400); echo json_encode(['error' => 'Phone number required']); exit; } $phone = htmlspecialchars($data['phone']); $country = htmlspecialchars($data['country'] ?? 'Unknown'); $lang = htmlspecialchars($data['lang'] ?? 'en'); $source = htmlspecialchars($data['source'] ?? 'unknown'); $to = 'hello@quixzoom.com'; $subject = 'New Zoomer Registration: ' . $phone; $message = "New Zoomer Registration\n\n"; $message .= "Phone: " . $phone . "\n"; $message .= "Country: " . $country . "\n"; $message .= "Language: " . $lang . "\n"; $message .= "Source: " . $source . "\n"; $message .= "Time: " . date('Y-m-d H:i:s') . " UTC\n"; $message .= "User Agent: " . ($_SERVER['HTTP_USER_AGENT'] ?? 'Unknown') . "\n"; $message .= "IP: " . ($_SERVER['REMOTE_ADDR'] ?? 'Unknown') . "\n"; $headers = 'From: noreply@quixzoom.com' . "\r\n"; $headers .= 'Reply-To: hello@quixzoom.com' . "\r\n"; $headers .= 'X-Mailer: PHP/' . phpversion(); $success = mail($to, $subject, $message, $headers); if ($success) { echo json_encode(['success' => true, 'message' => 'Notification sent']); } else { http_response_code(500); echo json_encode(['error' => 'Failed to send notification']); }