I'm sending an email with help of the sendgrid api v3 but got the warning/error:
Content with characters ', " or & may need to be escaped with three brackets {{{ content }}}
in my api json i'm adding an link containing the &
character:
{"dynamic_template_data": {"link":"...&..."}}
in my template i'm using the three brackets {{{ link }}}
Everything works as expected - email incl. link are send - but i always got the warning/error.
Do i miss something within the json?
I've looked at their code for node.js and as long as any content string has either a (",',&) it will console.warn the message your are seeing.
if (/['"&]/.test(value)) {
console.warn(DYNAMIC_TEMPLATE_CHAR_WARNING);
}
You can notice the difference with using 2 vs 3 brackets on sendgrid's email template below: