Deploy: 2026-05-22 00:22:23

This commit is contained in:
Hamza-Ayed
2026-05-22 00:22:23 +03:00
parent 9450af6c8e
commit 11b0bdf107
4 changed files with 38 additions and 7 deletions

View File

@@ -244,8 +244,12 @@ class WhatsAppController extends BaseController
if (!empty($replyText)) {
// Send reply back to the contact via Node.js Gateway
$gatewayUrl = getenv('WHATSAPP_GATEWAY_URL') ?: 'http://localhost:3722';
$sendUrl = $gatewayUrl . '/api/messages/send';
$gatewayUrl = rtrim(getenv('WHATSAPP_GATEWAY_URL') ?: 'http://localhost:3722', '/');
if (substr($gatewayUrl, -4) === '/api') {
$sendUrl = $gatewayUrl . '/messages/send';
} else {
$sendUrl = $gatewayUrl . '/api/messages/send';
}
$payload = json_encode([
'session_key' => $session['session_key'],