0.0.3 • Published 8 years ago
h2io-mailer v0.0.3
H2io - Mailer
Installation
npm install h2io-mailer
Usage
import { factoryMailgun } from 'h2io-mailer';
const opts = {
user: 'your_mailgun_username',
pass: 'your_mailgun_password',
};
const mailgun = factoryMailgun(opts);
const sendOpts = {
from: 'from.email@example.com',
to: 'to.email@example.com',
subject: 'Your subject',
text: 'Your text body',
html: 'Your <strong>html</strong> body',
};
mailgun.send(sendOpts, (err, info) => {
if (error) {
return console.log(error);
}
console.log('Message sent:', info.response);
});