2.0.0 • Published 8 years ago

seneca-sendgrid-mail v2.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

Build Status js-standard-style Greenkeeper badge

seneca-sendgrid-mail

Seneca SendGrid email plugin.

This is a module for the Seneca microservices toolkit. It's a plugin extension for seneca-mail to enable sending emails via SendGrid.

Visit the seneca-mail page for full usage documention.

Requires Node.js >= 8

Installation

$ npm i seneca
$ npm i seneca-mail
$ npm i seneca-sendgrid-mail

Usage

'use strict'

const seneca = require('seneca')()
const mail = require('seneca-mail')
const sendgridMail = require('seneca-sendgrid-mail')
const sendgridOptions = {
  key: 'YOUR_SENDGRID_API_KEY',
  tag: 'seneca-sendgrid-mail'
}
const email = {
  role: 'mail',
  cmd: 'send',
  text: 'Hi There!',
  to: 'alice@example.com',
  from: 'bob@example.com',
  subject: 'Greetings!'
}

seneca.use(mail)
seneca.use(sendgridMail, sendgridOptions)

seneca.ready(error => {
  if (error) {
    return console.log(error)
  }
  seneca.act(email, (err, response) => {
    if (err) {
      return console.error(err)
    }
    console.log(response)
  })
})

Thx

License

MIT

Robohash image of seneca-sendgrid-mail

2.0.0

8 years ago

1.0.15

9 years ago

1.0.14

9 years ago

1.0.13

9 years ago

1.0.12

10 years ago

1.0.11

10 years ago

1.0.10

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago