-
Notifications
You must be signed in to change notification settings - Fork 983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transactional template designer does not respect handle bars #70
Comments
I'm having this same issue as well, I thought I was messing something up. Probably wasted ~2 hours on this. It works correctly if you don't use tables though. so the following will work: <ol>
{{#each items}}
<li> {{this.text}} {{this.price}}</li>
{{/each}}
</ol> but this won't <table style="width:100%;" cellspacing="5" cellpadding="5" border="0" align="center">
<tbody>
{{#each items}}
<tr>
<td>{{this.text}}</td>
<td>{{this.price}}</td>
</tr>
{{/each}}
</tbody>
</table> I've filed a support ticket regarding this as well |
So it seems like this an issue with Sendgrid not following the best practices for using Handlebars. See handlebars-lang/handlebars.js#604 (comment) for more info on that. A work around for now is to just put the handlebars code in a comment. <table>
<tbody>
<!-- {{#each items}} -->
<tr>
<td>{{this.key}}</td>
<td>{{this.value}}</td>
</tr>
<!-- {{/each}} -->
</tbody>
</table> |
Yeah i just came across this myself, wasted a lot of time. I was able to get it to work correctly when using Pure HTML, not the designer. Using code snippets in the designer I was getting your exact results, but the Code Editor is fine, unfortunately I am not great at HTML so it is not idea. I just copy and pasted the example and removed whatever I didn't need. |
The problem is still there today. a year after. Also spent over an hour to narrow down the issue culprit. |
ya this is super annoying. Would love an update from sendgrid on it. |
Sendgrid support told they passed the issue to the engineering team. Though with the workaround above, thanks to @gurpreetatwal, this was easy to fix. |
Not to be cynical, but I doubt it's going to be fixed anytime soon. The issue was "passed to the engineering team" over a year ago. :/ I really wish they would at least make a note of it on the docs so that people don't waste their time. Oct 8, 2018
Oct 9, 2018
Oct 9, 2018
|
Is this solved . I wasnt facing this some time ago but from 3 - 4 days its been there. |
Actual Behavior
When creating a transactional template with the designer, code blocks aren't correctly formatted.
It looks like this after formatting:
Expected Behavior
It should look like this:
Steps to reproduce it
Create a code block in the transactional template designer UI and paste the code above.
The text was updated successfully, but these errors were encountered: