From aeb9fa261d4cfda84b0a19687735a56d0031d816 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Fri, 20 Jun 2025 01:26:21 +0000 Subject: [PATCH] Fix: Use correct email format in Evolution API webhook Ensure the Evolution API webhook uses the user's email with the "@" symbol in the URL, instead of replacing it with "_". --- src/services/whatsApp/webhookService.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/services/whatsApp/webhookService.ts b/src/services/whatsApp/webhookService.ts index adbab1d..0a53d2b 100644 --- a/src/services/whatsApp/webhookService.ts +++ b/src/services/whatsApp/webhookService.ts @@ -11,13 +11,11 @@ export const createEvolutionWebhook = async (userEmail: string): Promise => // URL do endpoint - mantém o @ normal no email const endpoint = `/webhook/set/${userEmail}`; - // No body, troca @ por _ no email - const emailWithUnderscore = userEmail.replace('@', '_'); - + // Agora mantemos o email original com @ também na URL do webhook const webhookBody = { webhook: { enabled: true, - url: `https://webhookn8n.innova1001.com.br/webhook/${emailWithUnderscore}`, + url: `https://webhookn8n.innova1001.com.br/webhook/${userEmail}`, webhookByEvents: true, webhookBase64: true, events: [ @@ -29,7 +27,6 @@ export const createEvolutionWebhook = async (userEmail: string): Promise => console.log('Dados do webhook:', { endpoint, emailOriginal: userEmail, - emailComUnderscore: emailWithUnderscore, webhookUrl: webhookBody.webhook.url });