Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
email-templates-effe
Advanced tools
A replacement engine for the node module email-templates and should support Foundation for Emails.
Email-templates-effe is an alternative engine for email-templates and add support for Foundation for Emails :email::mailbox::rocket:
install email-templates-effe
via npm:
npm install email-templates-effe --save
Or via yarn
yarn add email-templates-effe
Once installed you need to import the module and set up the root directory for handlebars:
const Email = require('email-templates');
const path = require('path');
const engine = require('email-templates-effe');
// Setup
const email = new Email({
views: {
root: path.join(__dirname, 'root/directory/to/all/email/files'),
options: {
extension: 'hbs',
engineSource: engine({
root: path.join(__dirname, 'handlebars')
})
}
}
});
// Using email engine:
email
.send({
template: 'hallo',
message: {
to: 'mail@domain.com'
},
locals: {
name: 'John'
}
})
.then(res => {
console.log('res.originalMessage', res.originalMessage)
});
.catch(console.error);
Or you can define all handlebars directory manually with layouts
, partials
and helpers
// ...Other Code
// Setup
const email = new Email({
views: {
root: path.join(__dirname, 'root/directory/to/all/email/files'),
options: {
extension: 'hbs',
engineSource: engine({
layouts: path.join(__dirname, 'handlebars/layouts'),
partials: path.join(__dirname, 'handlebars/partials'),
helpers: path.join(__dirname, 'handlebars/helpers')
})
}
}
});
// ...Other Code
configuration option | type | default | description |
---|---|---|---|
root | string | - | With root you can define root directory for handlebars with layouts , partials and partials as suborders. |
layouts | string | - | With layouts you can define an exact handlebars layouts path |
partials | string | - | With partials you can define an exact handlebars partials path |
partials | string | - | With partials you can define an exact handlebars partials path |
For the development you need Node.js v6 or higher. If you have Node.js installed you can use the following commands to run the test
Using npm:
npm install
npm run test:lint // Run lint test in watch
npm run test:watch // Run unit test in watch mode
or use yarn (yarn must be installed since it is not part of node.js.):
yarn install
yarn run test:lint // Run lint test in watch
yarn run test:watch // Run unit test in watch mode
We use SemVer for versioning. For the versions available, see the tags on this repository.
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details
FAQs
A replacement engine for the node module email-templates and should support Foundation for Emails.
We found that email-templates-effe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.