5 ms·
Just use MJML (https://github.com/mjmlio/mjml https://github.com/mjmlio/mjml) or mrml (https://github.com/jdrouet/mrml https://github.com/jdrouet/mrml). It solv
by halostatue 4y ago
Just use MJML (https://github.com/mjmlio/mjml https://github.com/mjmlio/mjml) or mrml (https://github.com/jdrouet/mrml https://github.com/jdrouet/mrml). It solves the real problems with building emails without introducing useless abstractions like JSX.
- Theryston 4y agojsx mail not only solves the compatibility issue like others do, it also has things like a mail client emulator. especially if you want to use it without being linked to a programming language, you can just use the CLI that will give you pure HTML and CSS, among that several features that were designed to improve and facilitate the creation of email templates
- derrikcurran 4y agoMJML is terrific (haven't tried MRML) but why do you consider JSX to be a useless abstraction but not MJML?
- BiteCode_dev 4y agoBecause you get 2 levels of indirection instead of 1. If 1 does the job equally well, you should choose 1. In fact, MJML can be used with any templating solution, so if your system already uses JSX, JSX doesn't add indirection, and you should use it. But if your system is not, adding JSX on top has just prevents you from hacking a shell scripts that generates the email in a few lines, generating the email from whatever backend you use, or just writing the template in a free form file without anything to install. You gain complexity, you loose flexibility.
- lucideer 4y agoI'm not sure what you mean by indirection in this instance. How does JSX use 2 levels? > MJML can be used with any templating solution Wouldn't that add complexity where JSX has less? Why use 2 systems (MJML + [templating]) when you can get away with 1 (JSX)? > adding JSX on top has just prevents you from hacking a shell scripts As far as I understand both are npm libraries so I can't see how one allows this where the other doesn't? Surely their application is the same usage pattern?
- deleted 4y ago[deleted]
- lries 4y agoAgreed that MJML is great, but I wouldn't call JSX a useless abstraction. Using JSX as a templating language for MJML has real benefits, like being able to use javascript directly in templates instead of having to remember handlebars/mustache/nunjucks/etc templating syntax. And libraries like mjml-react make it really easy. https://github.com/wix-incubator/mjml-react/ https://github.com/wix-incubator/mjml-react/
- Theryston 4y agoif you read a bit of the jsx mail documentation you will see that it not only allows you to use jsx in emails, it does that and gives you a complete development environment with even an email client simulator for you to be your email in time real
- rockwotj 4y agoCame here to saw we use mjnl react and it's awesome to be able to wrap mjml in your own components.
- evv 4y agoMJML-React is awesome to use because of the JSX support: 1. you can integrate real JS without using some templatey thing, and 2. type safety with TS, helpful for auto-completion and robustness Anyways it seems that Wix is no longer maintaining the project and Faire has taken it on: https://github.com/Faire/mjml-react https://github.com/Faire/mjml-react
- funstuff007 4y agoAgreed. We use Python + Jinja to create dynamic mjml.
- santialbo 4y agoI'm using mjml-react which gives me: - proper i18n with any react i18n library - js to create complicated emails - nicer component reuse story. - syntax highlighting and completion when used with Typescript - can be integrated with other nice js tools like Storybook for seeing all emails in one place and play with their props. How is that useless?
- Theryston 4y agoI don't call it useless, I know the power he has, so I think he must have more competitors and we're here for that.
- hombre_fatal 4y agoHNers need to learn to just ask people why they use a given tech instead of dismissing it outright because the HNer likes to do things a different way. The discourse would be much less boring.
- effisfor 4y agoI'm currently integrating MJML into a React/JSX context. From my vantage point, MJML is the abstraction. I once worked with a guy who kept looking over my shoulder and saying 'just use binary'. Nice guy, but they had to let him go.
- munbun 4y agoEarly versions of MJML used JSX class components.