1.0.2 • Published 2 years ago

@kznjunk/paperboy-gmail v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Paperboy Gmail

How?

require('dotenv').config()

const gmailConfig = {
    clientId: process.env.clientId,
    clientSecret: process.env.clientSecret,
    refreshToken: process.env.refreshToken
}

const { sendGmail } = require('@kznjunk/paperboy-email')(gmailConfig)

const fromEmail = 'no-reply@example.com'
const toEmail = 'user@example.com'
const title = 'Hello..'
const body = '..there!'

const res = await sendGmail(fromEmail, toEmail, title, body)
console.log(res)
// {
//   accepted: [ 'user@example.com' ],
//   rejected: [],
//   envelopeTime: 192,
//   messageTime: 470,
//   messageSize: 352,
//   response: '250 2.0.0 OK  16164...29 - gsmtp',
//   envelope: { from: 'no-reply@example.com', to: [ 'user@example.com' ] },
//   messageId: '<68...2b4@gmail.com>'
// }

Note

1.0.2

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago