sighmon / mjml-rails

MJML + ERb/Haml/Slim view template
https://mjml.io
Other
295 stars 64 forks source link

Support JSON MJML templates #84

Closed boardfish closed 3 years ago

boardfish commented 3 years ago

Context is shared with mjmlio/mjml#2343:

I'm working with Mailjet's templates API. Templates get returned from this in JSON format. If I can't get that converted back to standard MJML so that it's compatible with this library, it'd at least be good to be able to use it directly.

It's already compatible with the CLI, so I think the only gatekeeper here might be the validation that the file starts with an <mjml> tag.

boardfish commented 3 years ago

You can use my Ruby snippet to convert the MJML from JSON back to XML.