Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
email-templates-effe
Advanced tools
Changelog
Version 1.1.0 - 2018-05-28
ace2e0560c
] - Add setting option for hbs root directory (Nico Swiatecki)7d4b729240
] - Remove prepublishOnly script task (Nico Swiatecki)c4b3eb2c72
] - Fixed Fix syntax error and add emojis :wink: (Nico Swiatecki)94120a7e64
] - Fixed spelling and grammar mistakes (Nico Swiatecki)Readme
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.
The npm package email-templates-effe receives a total of 5 weekly downloads. As such, email-templates-effe popularity was classified as not popular.
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.