Closed natesilva closed 11 years ago
I believe it sends multipart/alternative emails, which requires a text version. You can generate a text version from html if you don't want to explicity define a text.ejs.
transport.sendMail({
from: 'Spicy Meatball <spicy.meatball@spaghetti.com>',
to: locals.email,
subject: 'Mangia gli spaghetti con polpette!',
html: html,
generateTextFromHTML: true
Hi @chovy,
I discovered the problem while using generateTextFromHTML
. But by that time, you’ve already called template(…)
and it’s already generated your HTML, ignoring style.css
.
My workaround was to create a blank text.ejs
.
But it should use your style.css
when generating the HTML, even if you have not created a text.ejs
file, blank or not.
Regards, Nate
If your template doesn’t have a
text.ejs
file, then yourstyle.css
is ignored.My understanding is that
style.css
is used to add inline styles to the HTML version of your e-mail (that is,html.ejs
), so it should work regardless of whethertext.ejs
is present or not.To reproduce
npm install email-templates
.templates
and copy the entirepasta-dinner
example template there (includinghtml.ejs
,text.ejs
andstyle.css
).<h1>
style is inlined.templates/pasta-dinner/text.ejs
.Expected results
The HTML output should be the same as before, including the inlined
<h1>
style.Acutal results
Styles from
style.css
are not present.Regards, Nate