I am currently sending text-based emails but would like to send proper brand based emails with Phoenix. I already have TailwindCSS setup, but would like to style my emails using the same.
Has anyone figured out how to do this? Or if that’s such a bad idea, what alternatives do you use ?
Maizzle doesn’t include markup abstractions that expand to table-based structures, such as <row> or <column> in other frameworks.
You code your emails the way you want to with HTML you already know, there’s no need to learn new tags or attributes.
Knowing that some email clients still need layouts coded with tables in order to ensure proper rendering, this might sound terrifying to some. However, depending on your audience, nowadays you can actually use modern HTML and CSS and have your layout look great in the majority of email clients. Introduction | Maizzle
Unfortunately, email clients haven’t caught up with web standards.
Instead of building the emails manually, you can also build a template with a visual tool (most of them are built on top of mjml) and then put placeholders in the generated HTML:
I might be missing something (has something substantially changed in that matter with 1.6?) but in 1.5 I went the same route I used countless times on Rails => an e-mail layout and templates (both html and text) rendered into e-mail message the way you see fit. But I rarely do extensive styling on e-mail messages. Usually only small, inline touch-ups here or there. With TailwindCSS, the issue is with how you want to provide the “TailwindCSS” actual CSS. Putting a CDN link in the <HEAD> my not work well… There is this old article:
which I think is still mostly valid today. IOW – unless you have a well-working automating tool at hand that could inline definitions of all Tailwind’s utility classes for you, you’re most probably better off with an external template builder as others suggested.