     event.from       or= defaultFromMail
     event.properties   = @addDefaults { options, username }
 
-    unless mqClient
-      console.error errMQClientNotSet
-      return callback errMQClientNotSet
-
-    sendMessage = ->
-      mqClient.exchange "#{exchangeName}", exchangeOpts, (exchange) ->
-        unless exchange
-          err = new Error "Tracker: Exchange not found to queue: #{exchangeName}"
-          console.error err
-          return callback err
-
-        exchange.publish '', event, { type: EVENT_TYPE }, (errored, err) ->
-          return callback err
-
-    if mqClient.readyEmitted then sendMessage()
-    else mqClient.on 'ready', -> sendMessage()
+    require("./socialapi/requests").publishMailEvent event, (err) =>
+      callback err # do not cause trailing parameters
 
 
   @page = (userId, name, category, properties) ->


    callback()

  errMQClientNotSet = new Error 'Tracker: RabbitMQ client not set'

  @track = (username, event, options = {}, callback = -> ) ->

    return callback null  unless KONFIG.sendEventsToSegment


Analytics = require('analytics-node')
analytics = new Analytics(KONFIG.segment)

module.exports = class Tracker extends bongo.Base

