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 "_".
This commit is contained in:
parent
d14f68d709
commit
aeb9fa261d
@ -11,13 +11,11 @@ export const createEvolutionWebhook = async (userEmail: string): Promise<any> =>
|
|||||||
// URL do endpoint - mantém o @ normal no email
|
// URL do endpoint - mantém o @ normal no email
|
||||||
const endpoint = `/webhook/set/${userEmail}`;
|
const endpoint = `/webhook/set/${userEmail}`;
|
||||||
|
|
||||||
// No body, troca @ por _ no email
|
// Agora mantemos o email original com @ também na URL do webhook
|
||||||
const emailWithUnderscore = userEmail.replace('@', '_');
|
|
||||||
|
|
||||||
const webhookBody = {
|
const webhookBody = {
|
||||||
webhook: {
|
webhook: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
url: `https://webhookn8n.innova1001.com.br/webhook/${emailWithUnderscore}`,
|
url: `https://webhookn8n.innova1001.com.br/webhook/${userEmail}`,
|
||||||
webhookByEvents: true,
|
webhookByEvents: true,
|
||||||
webhookBase64: true,
|
webhookBase64: true,
|
||||||
events: [
|
events: [
|
||||||
@ -29,7 +27,6 @@ export const createEvolutionWebhook = async (userEmail: string): Promise<any> =>
|
|||||||
console.log('Dados do webhook:', {
|
console.log('Dados do webhook:', {
|
||||||
endpoint,
|
endpoint,
|
||||||
emailOriginal: userEmail,
|
emailOriginal: userEmail,
|
||||||
emailComUnderscore: emailWithUnderscore,
|
|
||||||
webhookUrl: webhookBody.webhook.url
|
webhookUrl: webhookBody.webhook.url
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user