{"size": 885, "ext": "js", "max_stars_repo_path": "lib/init/mailer.js", "max_stars_repo_name": "geddy/geddy", "max_stars_repo_stars_event_min_datetime": "2015-01-01T16:04:42.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-01T20:40:56.000Z", "max_issues_repo_path": "lib/init/mailer.js", "max_issues_repo_name": "geddy/geddy", "max_issues_repo_issues_event_min_datetime": "2015-01-02T19:08:10.000Z", "max_issues_repo_issues_event_max_datetime": "2020-01-30T22:32:05.000Z", "max_forks_repo_path": "lib/init/mailer.js", "max_forks_repo_name": "geddy/geddy", "max_forks_repo_forks_event_min_datetime": "2015-01-07T11:43:06.000Z", "max_forks_repo_forks_event_max_datetime": "2019-01-28T16:07:47.000Z"}
{"max_stars_count": 260, "max_issues_count": 102, "max_forks_count": 57, "avg_line_length": 29.5, "max_line_length": 111, "alphanum_fraction": 0.5774011299}
(function() {
  'use strict';

  var utils = require('utilities');

  module.exports = new (function () {
    this.init = function (app, callback) {
      var cfg = app.config.mailer
        , mailer
        , msg
        , plugin
        , transport;
      if (cfg) {
        msg = 'Geddy mailer support requires Nodemailer. Try `npm install nodemailer`.';
        mailer = utils.file.requireLocal('nodemailer', msg);
        transport = cfg.transport;
        if(cfg.require) {
          msg = 'You have configured a 3rd party nodemailer transport. Try `npm install ' + cfg.require + '`.';
          plugin = utils.file.requireLocal(cfg.require, msg);
          app.mailer = mailer.createTransport(plugin(transport.options));
        } else {
          app.mailer = mailer.createTransport(transport.type, transport.options);
        }
      }
      callback();
    };

  })();
}());
