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.
curlymail
Advanced tools
Readme
Lightweight SMTP email server with mustache templates support for messages, it's built on top of Hogan.js and Emailjs, and runs on Node.js
var curlymail = require('curlymail');
// add a email account and connect it to its SMTP server
curlymail.addAccount( 'main', {
user: 'username@domain.com',
password: 'PA55W0RD'
});
// add a message template with mustaches
curlymail.addTemplate('weekly', {
from: "{{appname}}",
to: "{{username}} <{{email}}>",
subject: "Testing curlyMail",
html: "<html>{{filename}} is ready for download</html>",
attachments: [
{path:"path/to/photo.jpg", name:"renames.jpg"}
]
});
// data to render the template
var data = {
username: 'Mr. Code',
email: 'curlymail@domain.com',
appname: 'curlymail co.',
filename: 'Timetable',
// _attachments in render data will be added to message without being rendering
_attachments: [
{path:"path/to/file.zip", name:"timetable.zip"}
]
};
// send a message
curlymail.send( 'main', 'weekly', data, function (err, msg) {
console.log( err || msg );
});
npm install curlymail
Copy demo/accountSample.json
in demo/account.json
and add your mail account config to the new file. Then run:
npm run demo
Add or overwrite a message template.
Parameters:
Curlymail use Hogan.js for template rendering. Uses the same headers Emailjs, but this adds the html message properly as an attached document and will generate text message from HTML if text not passed.
Example:
curlymail.addTemplate( 'welcomeMail', {
from: "{{appname}}", // required
to: "{{username}} <{{email}}>", // required
cc: "aperson@domain.com, otherperson@domain.com",
bcc: "hideperson@domain.com",
subject: "testing emailjs",
html: "<html>Hello {{username}}!</html>",
text: "Hello {{username}}!",
attachments: [
{path:"./file.zip", name:"renamed.zip"}
]
});
Add an email account and connect it to its SMTP server.
Parameters:
Returns curlyMail when finish, so you can chain methods Same options as Emailjs
Connection options:
Example:
curlymail.addAccount( 'main', {
user: 'username@domain.com',
password: 'PA55W0RD',
host: 'smtp.gmail.com',
ssl: true
}).addAccount( 'secondary', { ... });
Send message from a mail account
Parameters:
Example:
curlymail.send( 'mainAccount', 'welcomeMail', {}, function (err) {
console.log( err || msg );
});
Note: _attachments
field in data object will be added to message
See mustache
See emailjs
npm run build-docs
© 2015 Jacobo Tabernero - jacoborus
Released under MIT License
FAQs
Lightweight email server with mustache templates support for messages.
The npm package curlymail receives a total of 9 weekly downloads. As such, curlymail popularity was classified as not popular.
We found that curlymail 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.