How can we prevent html entities for parts of the code? #1471
-
Our server uses handlebars with custom helpers to inject data into our email templates. We use a custom
How can I prevent this so the build looks like this?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Currently, people generally do a That being said, I would recommend you have a separate Node server that renders the email templates on demand with the props so that you don't need to deal with this kind of stuff. You would send something like an HTTP POST with the props (or variables, like in handlebars) and then it would respond with the rendered HTML. Talking with a lot of the people that go in the direction of using something like handlebars, it really is a pain, and there isn't much we can do honestly. It's just full of foot guns that you will need to think about. Here's a few that come to mind:
|
Beta Was this translation helpful? Give feedback.
-
Thanks! We'll throw a preprocessor before handlebars to replace them. Hoping to move away from handlebars eventually. |
Beta Was this translation helpful? Give feedback.
Currently, people generally do a
replaceAll
on the rendered HTML and use a script of their instead of ouremail export
. You would just need to replace all"
with actual quotes.That being said, I would recommend you have a separate Node server that renders the email templates on demand with the props so that you don't need to deal with this kind of stuff. You would send something like an HTTP POST with the props (or variables, like in handlebars) and then it would respond with the rendered HTML.
Talking with a lot of the people that go in the direction of using something like handlebars, it really is a pain, and there isn't much we can do honestly. It's just full of foot guns that y…