     (Q.all promises).then ->
 #      logger.info JSON.stringify reportMap
       for report in reportMap
+        if fetchUsers == fetchDailySubscribers
+          report.type = 'Daily'
+        else
+          report.type = 'Weekly'
+
         sendUserEmail report
+
       logger.info "sending user email "
       done()
 

  <html>
  <head></head>
  <body>
  <h1>OpenHIM Transactions Summary</h1>
  <div>
  <p>on the OpenHIM instance running on <b>#{config.alerts.himInstance}</b>:</p>
  <table>
  "
  for data in report.data
    do (data) ->
      text +="<tr><td>Channel - <b>#{data.channel.name}</b></td></tr>"
      text += "<tr><td>Channel Load - #{ data.data[0].load } transactions \r\n </td></tr>"
      text +=  "<tr><td>Transaction Average Response - #{ data.data[0].avgResp } \r\n </td></tr>"
  text += "
  </table>
  </div>


if process.env.NODE_ENV == "test"
  exports.sendReports = sendReports
  exports.fetchDailySubscribers = fetchDailySubscribers
  exports.fetchWeeklySubscribers = fetchWeeklySubscribers
  exports.fetchChannelReport = fetchChannelReport
