     (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()
 


if process.env.NODE_ENV == "test"
  exports.sendReports = sendReports
  exports.fetchUsers = fetchUsers
  exports.fetchChannelReport = fetchChannelReport

  <html>
  <head></head>
  <body>
  <h1>#{report.type} OpenHIM Transactions Summary</h1>
  <div>
  <p>on the OpenHIM instance running on <b>#{config.alerts.himInstance}</b>:</p>
  <table>
  <tr>
    <th>Channel Name</th>
    <th>Channel Load</th>
    <th>Ave response time</th>
    <th>Failed</th>
    <th>Successful</th>
    <th>Processing</th>
    <th>Completed</th>
    <th>Completed with errors</th>
  </tr>
      "
  for data in report.data
    do (data) ->
      text += "<tr><td><i>#{data.channel.name}</i></td>"
      text += "<td> #{ data.data[0].load } transactions </td>"
      text += "<td> #{ data.data[0].avgResp } </td>"
      text += "<td> #{ data.statusData[0].failed }  </td>"
      text += "<td> #{ data.statusData[0].successful }  </td>"
      text += "<td> #{ data.statusData[0].processing }  </td>"
      text += "<td> #{ data.statusData[0].completed }  </td>"
      text += "<td> #{ data.statusData[0].completedWErrors } </td></tr>"
  text += "
  </table>
  </div>
