You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your template doesn’t have a text.ejs file, then your style.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 whether text.ejs is present or not.
To reproduce
Create a project. npm install email-templates.
Create a directory called templates and copy the entire pasta-dinner example template there (including html.ejs, text.ejs and style.css).
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
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.
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
The text was updated successfully, but these errors were encountered: