     unless mqClient
       return console.error 'RabbitMQ client not found for class `Tracker` @sent-hil'
 
-    sendMessage =->
-      mqClient.exchange "#{exchangeName}", exchangeOpts, (exchange) =>
+    sendMessage = ->
+      mqClient.exchange "#{exchangeName}", exchangeOpts, (exchange) ->
         unless exchange
           return console.error "Exchange not found to queue: #{exchangeName} @sent-hil"
 
-        exchange.publish '', mail, type:EVENT_TYPE
+        exchange.publish '', mail, { type:EVENT_TYPE }
         exchange.close()
 
     if mqClient.readyEmitted then sendMessage()

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'}

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
