yads / nodemailer-express-handlebars

A plugin for nodemailer that uses express-handlebars view engine to generate emails
87 stars 30 forks source link

inline css and image #20

Closed derit closed 6 years ago

derit commented 6 years ago

how to include image and css inline for template?

yads commented 6 years ago

See this in the nodemailer documentation: https://community.nodemailer.com/using-embedded-images/

derit commented 6 years ago

for inline css?

On Tue, Nov 20, 2018 at 4:47 AM Vadim Kazakov notifications@github.com wrote:

See this in the nodemailer documentation: https://community.nodemailer.com/using-embedded-images/

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yads/nodemailer-express-handlebars/issues/20#issuecomment-440053378, or mute the thread https://github.com/notifications/unsubscribe-auth/AFI8NKWVaaUBnuTFeOLmV95qkzDtLD6Mks5uwycDgaJpZM4YbQCW .

yads commented 6 years ago

I mean for CSS, you can just include it in the hbs template can you not? Can you post an example of what you're trying to do if this doesn't help?

tuffant21 commented 4 years ago

For this, I think he means doing something similar to this: https://www.npmjs.com/package/inline-css. When sending emails, it seems that you don't want any style tags. Instead, they should be converted to inline css as explained here: https://www.mailgun.com/blog/transactional-html-email-templates/ ** Note, the library (premailer) for inlining css doens't seem to work all that great. That is why I linked the inline-css package above. It seems to work better.

Is there a way to inline css styles using this library?