Fehler: Ungültige Parameter';
exit;
} // Baue API-URL (zu deinem Node.js Server)
$apiUrl = 'https://a1fc43c1f332.ngrok-free.app/feedback/process?';
$apiUrl .= 'ticket=' . urlencode($ticket);
$apiUrl .= '&message=' . urlencode($message);
$apiUrl .= '&type=' . urlencode($type);
if (!empty($metadata)) {
$apiUrl .= '&metadata=' . urlencode($metadata);
} // cURL-Request zu ngrok (Server-Side, keine CORS-Probleme!)
$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'ngrok-skip-browser-warning: true',
'User-Agent: MailingworkKI-Feedback/1.0'
]);
curl_setopt($ch, CURLOPT_TIMEOUT, 30); $response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = curl_error($ch);
curl_close($ch); // Fehlerbehandlung
if ($error) {
http_response_code(500);
echo '
Fehler beim Verbinden zum Feedback-Server
'; echo '' . htmlspecialchars($error) . '
'; exit; } // Response ausgeben http_response_code($httpCode); echo $response; exit; // Wichtig: Verhindert WordPress-Footer ?>