Package Exports
- mail-manager-client
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mail-manager-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Mail Manager Client
const env = require('./config')
const axios = require('axios')
const mailer = require('./mail-client')(axios, env)const main = async () => {
// first aproach
const result = await mailer
.to('chen7david@me.com')
.subject('wow message')
.template('this is html')
.send()
// second aproach
const result = await mailer.send({
to: "chen7david@me.com",
subject: "new message",
template: "hello ${user.name}",
})
console.log(result)
}
main()output
{
isCargo: true,
serial: '44974',
createdAt: '2020-03-23T10:49:18.161Z',
details: {
accepted: [ 'some-email@me.com' ],
rejected: [],
envelopeTime: 882,
messageTime: 1570,
messageSize: 270,
response: '250 2.0.0 OK 1584960562 b26sm4901759oti.3 - gsmtp',
envelope: { from: 'some-sender-email@gmail.com', to: [Array] },
messageId: '<f6ea3a5c-b712-8143-7390-0455e25bc1e5@gmail.com>',
sent: true
}
}