Skip to content

JSbotHQ/trailpack-sendgrid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 <[email protected]>",
  to:      "[email protected]",
  subject: "Hello from trailpack-sendgrid",
  text:    "Please, report issues"
}).then(app.log).catch(app.log.error)