1.0.8 • Published 5 years ago

bz-mailer v1.0.8

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

bz-mailer

Install

npm install bz-mailer -S

Usage Example

const mailer = require("bz-mailer");
const path = require("path");
mailer.init({}, {
    view_path: path.join(__dirname,'mails'),
    mailgun: {
        api_key: 'YOUR MAILGUN API KEY',
        domain: 'MAILGUN DOMAIN',
    },
    sendgrid: {
        api_key: 'YOUR SENDGRID API KEY'
    },
    method: "sendgrid", // "sendgrid", "mailgun",
    default_from: "noreply@domain.com" // default from address
});

//send message
// set from address to null to use default address
mailer.send('no-reply@domain.com', 'fickyirwanto@gmail.com', 'test', 'test', {title: "test email", name:"Ficky"})
.then((body)=> {
    // show email generated
})
.catch((err)=> {
    // show error
})



// you can also use mailer.sendFrom to automatically use default from address
mailer.sendFrom('fickyirwanto@gmail.com', 'test', 'test', {title: "test email", name:"Ficky"})
1.0.8

5 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago