2.0.2 • Published 1 year ago

@27works/posto v2.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

posto

const EmailHandler = require('@27Works/posto')

const emailConfig = {
  apiKey: sendgrid.apiKey,
  fromAddress,
  fromName,
  sendEmail,
  templatePath: path.join(process.cwd(), templatePath)
}

const emailHandler = new EmailHandler(emailConfig)

const data = {
  to,
  cc,
  template,
  action_url: '/go',
  baseUrl: config.get('global.baseUrl'),
  membership,
  user
}

const emailResponse = await emailHandler.send(data)

const { bcc, cc, from, subject } = emailResponse.originalMessage