Mailing is a better way to develop and organize your emails in your React app. It gives you an organized place to put your templates and live reload so you can see your changes quickly, test responsive version, and QA them quickly using real email.
Beautiful looking email is hard to develop in a nodejs project -- you have to write in raw HTML, it’s hard to see what you’re doing, and there isn’t a standard place to put templates or a way to share code easily.
Over the past few weeks I’ve gone down a rabbit hole with some friends making a little framework for writing and testing emails using react components. It uses Mailjet’s very cool MJML components and the venerable nodemailer. This is a more polished version of a thing we’ve built into a few side projects. Hopefully it’s the last time we build it :)
FAQ
## Isn’t HTML simple?
Writing raw HTML for emails is a bit like making a website in 1999… table layout, inline styling, no JS at runtime. As modern web frameworks mature it becomes more and more arcane relative to the rest of the codebase. I’m sure that for some people the HTML is pretty easy but it puts me in an edit -> wtf outlook -> google loop. MJML fixed that for me.
## Why code emails at all?
There are a lot of nice no-code SaaS email solutions these days, but sometimes you want your app to be self-contained or need more automated testability or you want to enforce a design system programmatically. We’ve hit all of the above and we’re also just more comfortable expressing layout as code than learning a bespoke WYSIWYG editor.
At our real estate startup, one of our most loved features was an email digest of new properties matching your search criteria. It was a cornerstone retention mechanism and we had a ton of logic (and tests) ensuring that it was only sent twice per day, never sent the same property twice, ordered listings in a certain way, could be retried on failure, metered sends over time to avoid self-DDOS etc, etc. As we grew and started moving some stuff to Mailchimp and Iterable for marketing to own, product emails with a ton of logic stayed in the codebase where they could be tested. We suspect that won’t change any time soon.
Without further adieu, please check it out and LMK if you find it useful (or find bugs). Thanks for visiting our rabbit hole, happy to answer questions.
ARTE