Apologies if this does not belong here. I asked this question to Support, but they referred me to the GitHub org because it was too technical for them.
Using Handlebars, to access global variables inside of conditional or loop blocks you are required to prefix the variable with ../. In SendGrid UI you need to add a ../ for every nested block, or the variable won't be accessed.
When sending a test email though, the variables only get accessed if they are prefixed with a single ../. Multiple ones won't work. I've also been writing the email markup with a local setup of a simple Eleventy.js environment and Handlebars set to "^4.7.7". Here it also works with only a single nested notation.
Expected content
Expected to access global variables using a single ../, no matter how deeply accessed in conditional/loop blocks.
Actual content
Single ../ works on a local environment using Handlebars 4.7.7, and when sending the actual emails, but not in the UI.
Apologies if this does not belong here. I asked this question to Support, but they referred me to the GitHub org because it was too technical for them.
Using Handlebars, to access global variables inside of conditional or loop blocks you are required to prefix the variable with
../
. In SendGrid UI you need to add a../
for every nested block, or the variable won't be accessed.When sending a test email though, the variables only get accessed if they are prefixed with a single
../
. Multiple ones won't work. I've also been writing the email markup with a local setup of a simple Eleventy.js environment and Handlebars set to"^4.7.7"
. Here it also works with only a single nested notation.Expected content
Expected to access global variables using a single
../
, no matter how deeply accessed in conditional/loop blocks.Actual content
Single
../
works on a local environment using Handlebars 4.7.7, and when sending the actual emails, but not in the UI.Example code
SendGrid UI:
Actual emails sent by SendGrid & local handlebars 4.7.7: