node package manager

hof-emailer

A service for generating and sending html and raw emails for use with HOF services

HOF Emailer

An emailer service for HOF applications.

Installation

$ npm install hof-emailer --save

Usage

HOF Emailer exports a class which should be initialised with an options object containing the following config, which is used to build the email content.

  • steps : your step config
  • fields : your field config
  • data : a hash of field names and values
  • groupBySection : group fields into sections
  • subject : the email subject

Options

  • transportType: : Defaults to 'smtp' - nodemailer-smtp-transport. Also available is 'ses' - nodemailer-ses-transport.

smtp options

nodemailer-smtp-transport

  • host : Address of the mailserver. Required.
  • port <String|Number>: Port of the mailserver. Required.
  • ignoreTLS : Defaults to false.
  • secure : Defaults to true.
  • auth.user : Mailserver authorisation username.
  • auth.pass : Mailserver authorisation password.

If host and port are not set, transport used is nodemailer-stub-transport.

ses (AWS Simple Email Server API) options

nodemailer-ses-transport

  • accessKeyId : AWS accessKeyId. Required.
  • secretAccessKey : AWS accessKeyId. Required.
  • sessionToken
  • region . Defaults to 'eu-west-1'.
  • httpOptions
  • rateLimit
  • maxConnections

If accessKeyId and secretAccessKey are not set, transport used is nodemailer-stub-transport.