<commit_before>/* 
* @Author: <NAME>
* @Date:   2016-01-26 11:48:16
* @Last Modified 2016-01-26
*/

'use strict';

import MandrillService from './MandrillService'

export default class Mailer {

  constructor(app) {
    this.app = app;
    this.mailer = app.get('mailer')

    if(this.app.config.MANDRILL_APIKEY || app.config.mandrill.api_key) new MandrillService(app)

    this._services = [];
    this.mailer.gather('service', this._registerService.bind(this))
  }

  _registerService(service) {
    console.log('registering service')
    this.mailer.respond('send', service.sendMessage.bind(service))
  }
} <commit_msg>Small fix for checking api key<commit_after>/* 
* @Author: <NAME>
* @Date:   2016-01-26 11:48:16
* @Last Modified 2016-02-04
*/

'use strict';

import MandrillService from './MandrillService'

export default class Mailer {

  constructor(app) {
    this.app = app;
    this.mailer = app.get('mailer')

    if((app.config.mandrill && app.config.mandrill.api_key) || this.app.config.MANDRILL_APIKEY) new MandrillService(app)

    this._services = [];
    this.mailer.gather('service', this._registerService.bind(this))
  }

  _registerService(service) {
    console.log('registering service')
    this.mailer.respond('send', service.sendMessage.bind(service))
  }
} 
{'fraction_non_alphanumeric': 0.15085536547433903, 'fraction_numerical': 0.03421461897356143, 'mean_word_length': 3.988372093023256, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6108644', 'n_tokens_mistral': 486, 'n_tokens_neox': 440, 'n_words': 78}