[HN Gopher] JSX Mail: Ending All Your Problems When Creating Ema...
       ___________________________________________________________________
        
       JSX Mail: Ending All Your Problems When Creating Email Templates
        
       Author : Theryston
       Score  : 24 points
       Date   : 2022-10-05 20:17 UTC (2 hours ago)
        
 (HTM) web link (jsx-mail.org)
 (TXT) w3m dump (jsx-mail.org)
        
       | sentrms wrote:
       | Have been using TSX for email templates for quite some time now.
       | Works really well with just ReactDOMServer.renderToStaticMarkup()
       | and juice to inline css.
        
       | shortformblog wrote:
       | I'm a big fan of MJML (https://mjml.io), but I respect the nice
       | work done here.
        
       | tdeck wrote:
       | > 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.
        
       | 3np wrote:
       | Just don't forget the plaintext version!
       | 
       | Even Gmail/Outlook/Yahoo users may disable js and/or HTML when
       | reading mail.
        
         | andirk wrote:
         | 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.
        
         | tdeck wrote:
         | I'm assuming this precompiles the HTML before sending it, given
         | the render() call.
        
           | adamzochowski wrote:
           | Does render() also generate plaintext?
        
             | jeroenhd wrote:
             | 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) // <html>...<h1>John Welcome to jsx-
             | mail</h1>...</html>
             | 
             | (https://github.com/Theryston/jsx-mail)
        
       | pstoica wrote:
       | 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.
        
       | Hansenq wrote:
       | 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.
        
       ___________________________________________________________________
       (page generated 2022-10-05 23:00 UTC)