trailpack-sendgrid

0.0.3 • Public • Published

trailpack-sendgrid

Send transational emails via SendGrid and Trails
This project is built on top of the sendgrid-nodejs library so you can refer to his documentation for additional information

WARNING still work in progress, things can break

Install

Install manually or via generator-trails

$ npm install --save trailpack-sendgrid
yo trails:trailpack trailpack-sendgrid

Configure

Add Trailpack

// config/main.js
module.exports = {
  packs: [
    // ... other trailpacks
    require('trailpack-sendgrid')
  ]
}

Configure SendGrid

// config/sendgrid.js
module.exports = {
  apiKey: "key-******",
}

Usage

Send email via app.sendgrid.sendMail

app.sendgrid.sendMail({
  from:    "Your Email <your@email.it>",
  to:      "target@email.com",
  subject: "Hello from trailpack-sendgrid",
  text:    "Please, report issues"
}).then(app.log).catch(app.log.error)

Package Sidebar

Install

npm i trailpack-sendgrid

Homepage

trailsjs.io

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

9.34 kB

Total Files

17

Last publish

Collaborators

  • nishchit14