-
Notifications
You must be signed in to change notification settings - Fork 985
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
Can not use formatDate helper inside table #93
Comments
My workaround for that is that I use a div with display set to table-cell: It's not displaying correctly in the editor but the rendered email looks good. |
We have faced the same issue. The handlebar seems to break rendering when used in a loop inside a table tag . @tfuchs1 , thank you, your workaround did help. |
Ugh, this is very much an issue @adokarasev, and thanks @tfuchs1 for finding a workaround! I can confirm the workaround fixes the issue, but feels dirty and in my case not feasible due to using automated template generator. @JenniferMah @shwetha-manvinkurke @eshanholtz @thinkingserious wondering if we can get any eyes on this repository as the issues don't seem to be monitored? |
There's another issue with using loops, and that's if you have a JSON like this {
"loop": [
{
"foo": "Foo.loop"
}
],
"foo": "Foo.root",
}
and you reference |
Looks like this is still an issue, any update on that one? |
Hello, this bug still repros in March of 2023. If we could at least get some kind of indication that this is what's happening in the error message or in the documentation, it would be really helpful. I only found this issue after multiple days of troubleshooting. It's extremely difficult to diagnose because the template renders just fine within the editor preview, but when you attempt to send an email it fails completely, and all you get is a message that says "this message could not be sent", which is super unhelpful. If there is some way this issue could even just be linked in the error message it would've saved loads of time. Ideally, maybe it can be fixed? I don't understand how/why this error would occur, so I have no idea how complex it would be. It was very surprising to me when I found that the preview in the editor uses a different rendering system than the actual emails when they're sent. Are there any plans to unify them? It makes bugs 100x more confusing when you don't even know if what you're looking at is what will actually be in the email. It seems like there are several relatively simple ways this issue could at least be partially addressed as opposed to just leaving this issue open indefinitely. |
Hit this today, and would agree with comment above. Extremely frustrating to have no clue why the email works in the editor but fails when sending with a very generic error about template rendering. At least put a warning in the documentation that formatDate can not be used with #each. |
Just ran into this as well. Would love to get this fixed. Took a while to figure out why my template was rendering but not sending. The only error I see in the Activity logs is a generic "Template render failure" with no indication of why. |
Same her, for me formatDate does not work in the email template at all. When i take {{formatDate date "DD.MM.YYYY"}} out of the template email is being sent. |
@tfuchs1 Thanks for the fix! Did you still have this in a parent table? Or did you take it out of the table? |
@MarianaKWork Yes we had this inside of a parent table and it worked for the Browser-based Email Clients, but not for Desktop Clients like Apple Mail (the table view was broken/not formatted correctly). Therefore we ended up not using the |
Pretty sad an issue that is this simple is still open after nearly 2 years. |
This is still an issue. Instead of using formatDate I inserted the variable from data. These were the issues:
|
I can confirm that this is still an active issue, and that the user experience of finding out what is happening is unintuitive and frustrating. I had to use trial-and-error to figure out what was failing. Obviously, the best would be for this to work. In the mean time, I guess I'll pre-format all data for sendgrid. |
Workaround (non-css)The issue seems to be caused by the auto generated plaintext. Here is an example of a dynamic template affected by this issue <html>
<body>
<div>
<h1>Order history</h1>
<table>
{{#each user.orderHistory}}
<tr>
<td>
<p>You ordered {{this.item}} on {{formatDate this.date "DD/MM/YYYY"}}</p>
</td>
</tr>
{{/each}}
</table>
</div>
</body>
</html> In the template editor, if we disable the sendgrid setting:
The Manually fixing the plaintext fixes the template and cures the behaviour. I notice that the |
Actual Behaviour
Template should be rendered.
Expected Behaviour
Test email is not received. It's hard to say what is wrong. But when I replace table with
ul
or justp
tags it works ok.Steps to reproduce it
If you replace table with list it works fine. If you delete
formatDate
helper it also worksThe text was updated successfully, but these errors were encountered: