-bongo  = require 'bongo'
-{argv} = require 'optimist'
+bongo    = require 'bongo'
+{ argv } = require 'optimist'
 
-KONFIG       = require('koding-config-manager').load("main.#{argv.c}")
-{socialapi}  = KONFIG
-exchangeName = "#{socialapi.eventExchangeName}:0"
-exchangeOpts = {autoDelete: no, durable:yes, type :'fanout'}
+KONFIG        = require('koding-config-manager').load("main.#{argv.c}")
+{ socialapi } = KONFIG
+exchangeName  = "#{socialapi.eventExchangeName}:0"
+exchangeOpts  = { autoDelete: no, durable:yes, type :'fanout' }
 
 Analytics = require('analytics-node')
 analytics = new Analytics(KONFIG.segment)


    # force flush so identify call doesn't sit in queue, while events
    # from Go/other systems are being sent
    analytics.flush (err, batch)->
      console.error "flushing identify failed: #{err} @sent-hil"  if err


  @track = (username, mail, options={})->
    # use `forcedRecipient` for both username and email
    if forcedRecipient
      username = forcedRecipient


  KodingError = require '../error'

  { forcedRecipient, defaultFromMail } = KONFIG.email

  EVENT_TYPE = 'api.mail_send'

