News for hackers. Stuff that matters.
Re:Can I Email? by andrewmcwatters on Monday May 10, 2021 @09:44PM (#27113187)
I don’t want a framework to lie to me about what it is that I’m writing.

I’m not interested in learning MJML. I’m interested in learning what subset of HTML and CSS email clients render and rasterize to.

That’s it.

I’m sick of stupid developers shilling their software product that I’m suppose to build other products with.

They do it with these cutesy photoshop/illustrator logos and dribbble crafted color schemes and drop in things like made with love in (city) in their README.mds on GitHub.

I want tools, not someone’s amateur marketing campaign.

Re:Can I Email? by cameronh90 on Monday May 10, 2021 @09:50PM (#27113234)
"I’m interested in learning what subset of HTML and CSS email clients render and rasterize to."

Doesn't sound like you want a framework. Sounds like you want a book.

Re:Can I Email? by andrewmcwatters on Monday May 10, 2021 @09:53PM (#27113254)
Nope, plenty of CSS frameworks out there that don't try and make up their own tags.
Re:Can I Email? by cameronh90 on Monday May 10, 2021 @10:07PM (#27113365)
The thing about email is that renderers aren't even implementing the same spec. There is no common subset to learn. Every client implements some vague mess of 1997-era HTML/CSS mixed with different random modern features. Any attempt to try to write anything slightly advanced manually will drive you insane. Mail clients will mangle your code in ways you can't imagine. Every client will mangle it slightly differently. Even the same client on different operating systems will behave differently.

Tools like MJML take a compiler approach to email. Why waste time trying to figure out how to implement a for loop in machine code and keep it updated every time a new processor comes out when you can just let the compiler do it?

Re:Can I Email? by andrewmcwatters on Monday May 10, 2021 @10:14PM (#27113430)
Take the top email clients and you'll sure as hell find a common subset. I don't want something slightly advanced. Emails are text and images. That it's. There's nothing advanced about that, and I'm not looking for it, either.

The idea we need compilers for everything is idiot engineering.

Re:Can I Email? by cameronh90 on Monday May 10, 2021 @10:40PM (#27113612)
If you just want text and images, you don't need CSS. Just the <img> tag - and even there you'll run into differences if you try and use the alt attribute.

And even that isn't trivial. For example, say you include an basic black on white icon, what happens if the user is using dark mode? If the image is transparent, it becomes entirely invisible. If it's non-transparent then it's ugly (white box). If you want to make it change depending on dark or light mode, now you have to use responsive CSS which works entirely differently in different mail clients. What happens if the image is bigger than their viewport? Hint: it is different in different clients.

And speaking of mail clients: one of the most popular mail clients is Outlook, which on Windows uses the Microsoft Word(!) HTML renderer and on Mac it uses WebKit. Gmail on web has its own HTML parser that outputs different HTML to what you wrote (and mangles your CSS class names). Apple Mail is probably the easiest to deal with.

It's not worth learning this stuff if you don't have to. It will not benefit your life in any way. The common subset you want is text/plain.

Re:Can I Email? by sbuk on Tuesday May 11, 2021 @03:40AM (#27115328)
The very site this thread is about addresses exactly this. The tl;dr is look at what is supported by Outlook.
Re:Can I Email? by 1123581321 on Monday May 10, 2021 @10:36PM (#27113588)
MJML is abstracted from Mailjet’s email builder. It’s based on real-world HTML needs and the stuff it renders is pretty easy to read. You’ll end up re-implementing something like it if you try to go simpler but have a lot of work to do.

It’s also easy to teach to designers.

Re:Can I Email? by SilverRed on Monday May 10, 2021 @10:14PM (#27113429)
>learning what subset of HTML and CSS email clients render

You can use Table and all its related fields, span, h_, and p. Anything else is risky.

For CSS you can set the font color and size. Setting a font itself is risky. Avoid using anything else including margins and padding as these largely don't work properly. multi layered tables are your margin and padding system. You also can only use inline styles. No classes, style tags or linked styles.

Thats about it for email. Have fun.

Re:Can I Email? by andrewmcwatters on Monday May 10, 2021 @10:17PM (#27113461)
Great! Now document it, create a getting started template, some component snippets, and examples, and you basically have a project that I want in my toolkit.
Re:Can I Email? by function_seven on Monday May 10, 2021 @11:16PM (#27113849)
Not being snarky here: Isn't that what MJML is? It has components and examples and does all the nasty nesting table hacks for you.

Asking because all I know of it is from their site. I have not used it myself. Does it have its own glitches that come along during the attempt to patch over other glitches?

Re:Can I Email? by andrewmcwatters on Monday May 10, 2021 @11:34PM (#27113948)
No, it emphasizes itself over standards, and promotes compiling beyond the scope of inlining CSS. That's enough to turn me off. It's self serving. It's not serving my needs.
Re:Can I Email? by lights0123 on Monday May 10, 2021 @09:56PM (#27113283)
https://maizzle.com/ does that—of course, you'll then have to deal with using tables to layout content manually instead of using MJML's abstractions.