Faire / mjml-react

React component library to generate the HTML emails on the fly
https://www.npmjs.com/package/@faire/mjml-react
MIT License
375 stars 16 forks source link

add mention of `mjml-dynamic` #79

Closed mifi closed 1 year ago

mifi commented 1 year ago

First thanks for taking over the project. I agree that it's too good to go!

One pain point for me using mjml-react is that you cannot easily use one of the many excellent templates and inject dynamic partial content using react. You would have to rewrite the whole template to React, and in that case you loose all previewing in VSCode and existing tooling. So I created a little library to allow replacing parts of the MJML JSON tree with any content, including mjml-react subtrees. So I hope this mention can help other people discover this technique!

also fix a typo

IanEdington commented 1 year ago

I agree that the templating support of pure mjml was lacking which is part of why we move to mjml-react. What would the benefit be of using this with mjml-react?

mifi commented 1 year ago

The benefit of using this is that you can create email templates using normal mjml tooling (or take designs from mlml.io/templates), and only replace parts of the document with mjml-react. This allows for designers/non-developers to design the overall layout of a mjml file (mjml-react markup cannot easily be previewed in vscode for example), while still allowing to show some dynamic partial content with mjml-react. It also means that you don't have to port the whole design to mjml-react. See example here: https://github.com/mifi/mjml-dynamic#practical-example-usage-with-mjml-react

IanEdington commented 1 year ago

I think your project is cool and it definitely solves a problem within the MJML ecosystem.

We're not adding links to external libraries at this time. In the future we might consider it but we'd be more likely to link to a section in the MJML docs like this https://documentation.mjml.io/#ports-and-language-bindings