Live data from Hacker News

JSX Mail: Ending All Your Problems When Creating Email Templates

jsx-mail.org

1–10 of 60 posts

Re: JSX Mail: Ending All Your Problems When Creating Email Templates

#4
> Which of these two codes can you understand faster?

The first one, definitely! The first one shows the structure of the document and places the button in context. I cant actually tell that the second example is equivalent, since there's no "rest of the document" or if there is it's done by magic behind the scenes.

Edit: I don't want to come off as too harsh on this project, this example is relatively simple so it probably doesn't show off the power of programming your email templates as code.

Re: JSX Mail: Ending All Your Problems When Creating Email Templates

#5
post #2

Just don't forget the plaintext version! Even Gmail/Outlook/Yahoo users may disable js and/or HTML when reading mail.

Furthermore, save for some nice branding color schemes, better font sizing, and maybe a few other useful UI features, an email should be almost all text and images. It should be treated more like a postal letter or a chatroom message.

Re: JSX Mail: Ending All Your Problems When Creating Email Templates

#7
post #6
post #2

Just don't forget the plaintext version! Even Gmail/Outlook/Yahoo users may disable js and/or HTML when reading mail.

I'm assuming this precompiles the HTML before sending it, given the render() call.

Does render() also generate plaintext?

Re: JSX Mail: Ending All Your Problems When Creating Email Templates

#8
The issue with building emails is the lack of modern CSS support across most email clients. It's incredible the fallbacks you need to go to (raw CSS tables) if you can't use flexbox, css grid, or any number of modern CSS rules.

This project is cool, but doesn't solve the fundamental issue that CSS support in email clients is just very poor.

Re: JSX Mail: Ending All Your Problems When Creating Email Templates

#9
Check out https://mailing.run. Similar project that can be embedded or run as a standalone API. Also uses MJML which is indispensable for cross-client compatibility.

Another tip, I highly recommend a CSS minifier which inlines styles to fix a variety of CSS priority issues.

Re: JSX Mail: Ending All Your Problems When Creating Email Templates

#10
post #6

Earlier quoted context omitted.

I'm assuming this precompiles the HTML before sending it, given the render() call.

Does render() also generate plaintext?

The example on Github doesn't seem to:

    // js-side
    import { render } = from 'jsx-mail';
    const template = await render('Welcome', { name: 'John' });
    
    console.log(template) // ...John Welcome to jsx-mail...
    
(https://github.com/Theryston/jsx-mail)
Post reply on HN