function Mailer(config, logger) {

  // Grab a configuration if present ...
  // ... otherwise throw an error
  this.config = config[name];
  if(!this.config) {
    // FIXME: add a better error mechanism
    throw 'Mailer missing config';
  }

  this.logger = logger.log.child({module: 'mailer'});

  // initialize the nodemailer transporter
  this.transporter = nm.createTransport({
    service: config.service,
    auth: {
      user: config.user,
      pass: config.pwd
    }
  });

}
/**
 * Provides mail service that wraps the nodemailer library. This object creates
 * a pool of resources that are connected to the mail service. These connections
 * are only closed when the object is destroyed or if close is explicitly 
 * called.
 *
 * @constructor
 * @param {Object} config         - a mail configuration object
 * @param {String} config.service - name of the mail service provider
 * @param {String} config.user    - email to use for the mail service
 * @param {String} config.pwd     - passwod to use for the mail service
 */
Provides mail service that wraps the nodemailer library. This object creates
a pool of resources that are connected to the mail service. These connections
are only closed when the object is destroyed or if close is explicitly
called.


Provides mail service that wraps the nodemailer library . This object creates a pool of resources that are connected to the mail service . These connections are only closed when the object is destroyed or if close is explicitly called .
function Mailer(config, logger) {
  this.config = config[name];
  if(!this.config) {
    throw 'Mailer missing config';
  }
  this.logger = logger.log.child({module: 'mailer'});
  this.transporter = nm.createTransport({
    service: config.service,
    auth: {
      user: config.user,
      pass: config.pwd
    }
  });
}
function Mailer ( config , logger ) { this . config = config [ name ] ; if ( ! this . config ) { throw 'Mailer missing config' ; } this . logger = logger . log . child ( { module : 'mailer' } ) ; this . transporter = nm . createTransport ( { service : config . service , auth : { user : config . user , pass : config . pwd } } ) ; }
Provides mail service that wraps the nodemailer library.
Provides mail service that wraps the nodemailer library .
// Grab a configuration if present ... // ... otherwise throw an error // FIXME: add a better error mechanism // initialize the nodemailer transporter