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
Install manually or via generator-trails
$ npm install --save trailpack-sendgrid
yo trails:trailpack trailpack-sendgrid
// config/main.js
module.exports = {
packs: [
// ... other trailpacks
require('trailpack-sendgrid')
]
}
// config/sendgrid.js
module.exports = {
apiKey: "key-******",
}
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)