Comments (9)
EJS has an include directive https://github.com/visionmedia/ejs#includes
from email-templates.
Perhaps see #35 ?
from email-templates.
Ah, thanks. Will try it out.
from email-templates.
It seems that includes won't work. At least not including a css file at the moment. They are included, but not inlined. It seems that #37 would fix this?
from email-templates.
Per this commit https://github.com/nicjansma/node-email-templates/commit/6055829c2a6b9f001b74f6b2a474d99905bd09e6 you can use EJS with include
and layout
helpers. EJS requires locals.filename
for relative paths of include
and layout
. Main documentation is https://github.com/visionmedia/ejs#layouts and see https://github.com/chovy/express-template-demo/blob/master/demo/views/index.ejs and https://github.com/chovy/express-template-demo/blob/master/demo/views/layout.ejs for examples of this.
from email-templates.
@niftylettuce I am not sure we understand each other. I have no problem with using include
- the css is included between style tags (that works), but it is not inlined by juice. Without inlining, the styles are not applied in email.
from email-templates.
Broken @include statements were fixed for LESS in #61 and should now be inlined by juice. However, we should test out similar functionality for the other supported preprocessors before resolving this.
from email-templates.
Hey guys,
Is there a way to share the style file (style.css
) for all the templates? For example by putting it in the root templates directory.
Thanks,
Philmod
from email-templates.
Yes, you can do something like this...
Folder named ./emails/
. Inside of it you have different email templates, e.g. ./emails/welcome-message/
and ./emails/forgot-password/
. Each of these folders has html.ejs
of course and then an accompanying stylesheet style.less
. At the top of style.less
you have a line such as @import "../style.less";
which would import a global stylesheet located at ./emails/style.less
.
from email-templates.
Related Issues (20)
- [fix] "Cannot find name 'HTMLElement')." Underlying package Juice is abandoned HOT 5
- Double quote on subject HOT 1
- Is there any date/number/currency formatting tools with i18n? HOT 1
- [fix] Syntax error when imported HOT 2
- [fix] Unable to send dynamic template from DB HOT 1
- [fix] Unable to use plugin HOT 2
- [fix] Pug block extends doesn't work HOT 1
- [fix] i18n - auto translate HOT 1
- [feat] extract locale phrases AOT HOT 3
- [fix] The juice step does not seem to be working HOT 1
- [feat] - AWS s3 as a source for template files HOT 2
- Critical and high severity vulnerabilities HOT 1
- [fix] CC emails not working if we specify mutiple emails instead of single HOT 6
- [fix] CC emails not working if we specify mutiple emails instead of single email HOT 2
- [fix] Move preview-email to devDeps
- [fix] DESCRIPTIVE TITLE HOT 1
- [fix] Peer dependency needs a bump @loadjs/consolidate HOT 1
- Getting monorepo-symlink-test Security Vulnerability warning due to resolve package of email-templates
- [fix] issue with eta.js HOT 5
- [DEP0174] DeprecationWarning: Calling promisify on a function that returns a Promise is likely a mistake. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from email-templates.