0.0.3 • Published 5 years ago

trailpack-sendgrid v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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)