-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Open
Description
Description
When sending messages with line breaks from Chatwoot to WhatsApp via Evolution API native integration, a backslash \ is added before each newline character.
Environment
- Evolution API version: 2.3.7 (latest)
-
- Chatwoot version: 4.10.1
-
-
- Integration type: Native Chatwoot integration via Evolution panel
-
Expected behavior
Message sent from Chatwoot:
Teste
Quebrando
Linhas
Actual behavior
Message received on WhatsApp:
Teste \
Quebrando \
\
Linhas
Evidence from logs
The message is already arriving with escaped backslashes in Evolution:
message: Message {
extendedTextMessage: {
text: 'Teste \\\nQuebrando \\\n \\\nLinhas',
contextInfo: [Object]
}
}Test performed
Sending directly via Evolution API (without Chatwoot) works correctly:
curl -X POST "https://evo.domain.com/message/sendText/INSTANCE" \
-H "apikey: xxxxx" \
-H "Content-Type: application/json" \
-d '{"number": "5511999999999", "text": "Test\nBreaking\n\nLines"}'This message arrives correctly on WhatsApp without backslashes.
Conclusion
The issue occurs in how Chatwoot sends the webhook to Evolution, or how Evolution processes the incoming Chatwoot payload. The text is being double-escaped somewhere in this flow.
Suggested fix
Add a sanitization step when receiving messages from Chatwoot:
text = text.replace(/\\\n/g, '\n');Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels