7 ms·
Help me understand the React selling point. Existing email sending software supports text and HTML because that's what email is. No email client out there suppo
by paxys 3y ago
Help me understand the React selling point. Existing email sending software supports text and HTML because that's what email is. No email client out there supports JavaScript, virtual DOMs, event loops, SSR or any such fancy web technology.
Instead of hand-crafting an HTML template with <title> <p> <a> <h1> <img> <div> etc I'm supposed to use your custom React components (<Button> <Image> <Hr> <Link> ...) which you will promptly compile down to the tags I mentioned above. So...what value am I getting out of React at all?
- gvkhna 3y agoAgreed react doesn’t make sense for email. But the syntax can be better than classic templating languages. Seems like a better technology would be Astro.build. Basically same syntax as react but it’s really designed around static HTML generation only.
- deleted 3y ago[deleted]
- addandsubtract 3y agoYou get the comfort of using react components instead of fighting with HTML tables to make your emails look nice. I think it's awesome! It's analog to what ink[0] does with CLI outputs. Sure, you could write fancy CLI outputs in bash, but ink takes the pain out of it and makes it easy. [0] https://github.com/vadimdemedes/ink https://github.com/vadimdemedes/ink
- zenorocha 3y agoSure! Most front-end teams are using React nowadays. What happens when you adopt another email service is that they want you to learn the template language that they use - Handlebars, Mustache, etc. Instead of having to learn how to do things with that language, your front-end team can re-use everything they already know from React land. Imagine being able to import the same button you have on your web app into your email template. Not only that, but you can also use stuff like Tailwind to help with the styling of your email.
- mbesto 3y agoYa, but why does a transactional email service have anything to do with the front-end....I feel like I'm missing something very obvious but I can't seem to figure it out...
- douglaswlance 3y agoEmails are rendered like websites with a reduced featureset.
- winphone1974 3y agoThis isn't really true. More like static pages targeting a million different rendering engines with unbalanced feature support
- avree 3y agoI don't mean this snarkily, but have you ever used a transactional email service? Literally all of them support frontend, I'd much rather use something like React than "Handlebars" (which Sendgrid requires https://docs.sendgrid.com/ui/sending-email/how-to-send-an-email-with-dynamic-templates https://docs.sendgrid.com/ui/sending-email/how-to-send-an-em...)
- mbesto 3y agoI've used pretty much all of them and in most cases you're sending the request via some message queue (front-end -> async to back-end -> message queue -> async returns to back-end DB), which is managed on the backend. I'm scratching my head as to why relying on the browsers threading to do seems like it offers any advantages...
- kiliancs 3y agoHTML for emails is notoriously difficult to get right. To be decent, HTML emails require arcane CSS rules, inline CSS, table layouts, etc., and testing in many different clients (because they all have their own quirks). Fixing something in for a client without breaking it for another client is not straight-forward either. Email solutions have worked around this via premade components—as a template, in React, or even as a UI with drag and drop.
- csomar 3y agoIt's what every software developer out there using mindlessly. They are just putting React components and mixing them. NextJS also helps shield them from the back-end. You'd be surprised how many of them cannot differentiate between the back-end and the front-end and which parts are being executed by the server (it's netlify!). Anyway, maybe I am getting too old?
- k3liutZu 3y agoI don't think it's just us getting old. Newcomers to the filed don't really understand HTML and CSS. It's just "React components" to them, and they aren't looking deeper than that.
- whstl 3y agoI'm getting the feeling that a lot of old timers also don't understand HTML and CSS in emails, from the responses I'm seeing here. There are a lot of reasons to have abstractions over HTML/CSS in emails, for all but the trivial cases. It is notoriously difficult to get right, since there are some features lacking and standards in the email client space moves way slower than browser. A regular marketing HTML email would look unrecognizable to a lot of old timers.
- Aeolun 3y agoAs long as you stick to only HTML that was available in the year 2000, and use zero CSS, your mails will come out the same in pretty much every client.
- stnmtn 3y agoAbsolutely, but show what this will look like to the marketing team and they will, probably rightly, tell you that times have changed. For a major brand, CSS and pretty design is a requirement for all branded emails.
- 3y ago
- arek_nawo 3y agoI see it more as a way to provide better Developer/User Experience over existing mailing services. It seems to be the main selling point of the entire platform. Given that it's price-competitive with other services, it might be enough to attract users looking for new solutions and possibly even convert those already using other services. On a side-note though, emails really need an update. No, they don't have to support JS, but at least modern CSS options. Adjusting layout with tables and CSS float just doesn't seem right nowadays. I basically always use an email builder, just because desiging a good email is so tiresome. Using React can help make it easier, but some work has to be done by the email clients to get more up to speed with modern Web standards.
- whstl 3y ago"Instead of hand-crafting an HTML template with <title> <p> <a> <h1> <img> <div> etc" You forgot a whole lot of <table>, all the inline CSS and all the IE11 comment hacks. Oh, and also OfficeHTML or whatever abomination that is called, because Microsoft Word 2003 also remains alive inside Outlook. Most people doing anything of medium complexity is already using some abstraction layer, such as MJML [1]. Also remember you gotta either test on multiple clients, or use something like Litmus. HTML emails are no fun. [1] https://mjml.io/ https://mjml.io/
- iamacyborg 3y ago> Most people doing anything of medium complexity is already using some abstraction layer, such as MJML Citation needed. I’m an admin for the largest email community online (emailgeeks) and when folks talk about code, everyone is talking about writing this stuff by hand.
- nathansherburn 3y agoThis seems wild to me. Can you share examples of the complexity of the emails people are coding by hand? This sounds like a pretty amazing art form if people are building cross-client compatible, rich, modern email designs with tables and inline styling.
- iamacyborg 3y agoCheck out this talk from Mark Robbins from 2018, he's been leading the industry with interactive email for a long time now. https://www.youtube.com/watch?v=l7i7YDPcAcM https://www.youtube.com/watch?v=l7i7YDPcAcM
- fkyoureadthedoc 3y agoI don't think this supports your point of "everyone" talking about doing this by hand. If anything this guy is an outlier.
- geoffeg 3y agoI was in a meeting a while back where a team that was tasked with standing up a few dozen completely static websites was discussing what React components to use. I asked why they were using any front-end JS framework at all and not just creating static html sites, maybe using a generator like Hugo or Eleventy if they wanted to templatize. The answer was that they didn't know how to create plain html sites without JS. That was moderately shocking to me. I offered to work with them to create the static html solution and they declined, saying they could be more productive with React.
- thex10 3y agoIt sadly no longer shocks me, I've seen many "front-end" engineers rely on React as a sort of crutch for building UIs. Even for non-interactive UI. :(
- onion2k 3y agothey declined, saying they could be more productive with React As much as it pains me to say so, they're probably right. If they don't know how to make a static site, and they're familiar with something like Next, then they probably can go faster and just let the framework take care of building the assets. I wish people still made static sites using boring tech but times have moved on, but honestly there isn't much difference in complexity between a NextJS static site and a Hugo or an 11ty static site.
- geoffeg 3y agoOh, I'm sure they're right, but it was wild to me, someone who starts any new web-based project with a static html page.
- ssijak 3y agoyou can make a static site with NextJS too Edit: And OP mentioned he suggested Hugo or some other solution which is miles behind tools in JS/TS world. Not to mention it is Python based and this team knew React
- satvikpendem 3y ago
- wbobeirne 3y agoHaving worked on a number of product email systems where you have an existing codebase, while not exactly intuitive this is basically exactly what I've wanted. You can easily code share environment-agnostic code with your frontend (Things like user-facing text formatting, localization, handling of commonly shaped API objects like users, generating links to specific pages.) It also leans into a lot of email code best practices. Clear inputs and outputs and unidirectional data flow with React props, building reusable and composable components that work in all email clients without having to hand-rewrite table tags, and an easy way to inject test data or build out email templates before you have real data. I've used react-email on one project now, and would happily re-use it in a future project where a team is amenable to having some TypeScript in their backend. My one complaint / feature request is that it'd be really nice to have a way to basically "export" react-email into low or no dependency functions, since effectively all it's doing at the end of the day is providing you a function where you pass it an object, and it returns a string.
- klysm 3y agoReact is a really good template language and allows you to stay consistent with branding across multiple products with minimal investment
- zenorocha 3y agoExactly. High consistency + low investment, that's the perfect combo