n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
48.95k stars 7.78k forks source link

Brevo Node: Incorrect Parameter Parsing with Comma and Equals Characters in Template Parameters #8754

Open vlazic opened 8 months ago

vlazic commented 8 months ago

Bug Description

When attempting to send transactional emails using the Brevo Node in n8n with template parameters that include , or = characters within the values, the validateAndCompileTemplateParameters function incorrectly parses these characters as delimiters, leading to unintended behavior in parameter parsing.

This issue arises because the function uses , to split parameters and = to separate keys from values, without accounting for cases where these characters are part of the parameter values themselves.

To Reproduce

  1. Create a workflow that includes the Brevo Node for sending transactional emails.
  2. In the "Additional Fields" section of the node configuration, add template parameters that contain , or = characters within the values.
  3. Execute the workflow.
  4. Observe that the parameters are not parsed as expected, with , or = characters within values being treated as delimiters.

Expected behavior

The validateAndCompileTemplateParameters function should accurately parse template parameters, even when values contain , or = characters. These characters should be recognized as part of the value strings, not as delimiters or separators.

Operating System

n8n cloud

n8n Version

n8n cloud

Node.js Version

n8n cloud

Database

PostgreSQL

Execution mode

main (default)

Joffcom commented 8 months ago

Hey @vlazic,

Thanks for the report, I have created NODE-1182 as the internal ticket for this.

thulsadum commented 2 weeks ago

Hi all, I encountered the same issue. I wonder why the template parameter passing has been designed that way? It will be parsed into an an JS Object. Wouldn't it be better to just take in an Object in a JSON? I understand that would be a breaking change, but would be more flexible and intuitive to work with, imho. Cheers.