Open joshmcarthur opened 3 years ago
Do we need to care about this being in Webpack?
My instinct is that we probably won't want to re-use stylesheets between the app and the inlined mail styles. Obviously these styles will be related but I think copy & paste is probably safer.
This should probably be a new variant eh?
Discussion outcome:
We frequently use template email layouts, typically Postmark's. These templates, and many others, advise using an email HTML preprocessor such as premailer to inline CSS onto the elements. Apparently using
<style>
tags and or<link rel="stylesheet"
has mixed support in different email clients. Premailer can also generate plaintext versions of emails, which is a useful thing to do for accessibility/client support if plaintext templates are not provided by a developer.Email layouts are something that is frequently disregarded or left until the last minute, so providing a sensible default here would also be useful. Just a single column with header and footer will take care of most projects' needs.
Premailer does not currently support webpacker, although there is a lengthy issue describing how support can be added for it. This doesn't currently impact my project since I'm using the Postmark template with an inline
<style>
tag, so this may or may not be an issue.