Open radiovisual opened 10 months ago
I should point out that even though the documentation on equals
says this:
my example does not show any coercion happening, I am comparing strings to strings, so I would expect that this statement from the docs does not apply in my usage example. Or am I wrong?
Actual Behaviour
The Handlebars conditional statements are not behaving the same way in the SendGrid Email Template Preview application (via
https://mc.sendgrid.com/dynamic-templates/{id}
) and the email that is delivered to the email inbox.Expected Behaviour
The Handlebars logic should behave the same in the Email Preview app and in the Email that is generated by the SendGrid API
Steps to reproduce it
Create a minimal email template example with the following HTML + Handlebars markup:
and use the following JSON data to power the template:
LogCat for the issue There are no errors reported anywhere. Only inconsistent Handlebars behaviors.
Screenshots of the issue
Example 1: Empty Description
I would expect the template to render that the descriptions are not equal and that the descriptions have changed, and this is what appears in the SendGrid Preview App, but in the actual email that is sent to the inbox, it says
"Description changed"
not the expected"Description removed"
Example 2: No change in description
I would expect to see "Description not changed" in both places, but, the actual email thinks the descriptions are different, showing something different than the preview app:
Example 3: Changed description
Here I expect to see "Description changed" in both places, and this time it works as expected in both places
Would you like to work on the issue?
I can of course try to help, but I honestly think this has nothing to do with the email-templates directly. My theory is that the problem is that the Handlebars logic is not the same in the preview app than it is on the SendGrid API.
Note that I was asked to open this issue on Github via SendGrid support ticket number 13993343