       return
     today = moment()
     twoWeeksAgo = today.subtract(2, 'weeks')
-    Organization.generateReport twoWeeksAgo, today
+    Organization.generateReport(twoWeeksAgo, today)
+      .catch((err) ->
+        Logger.errorToSlack "Failed to produce a salary report", err
+      )
+      .done(
+        (numberDone) ->
+          Logger.logToChannel "Salary report generated for #{numberDone} employees",
+                              'ibizan-diagnostics'
+      )
 
   # Users should receive a DM “chime” every other Friday afternoon to
   # inform them that payroll runs on Monday, and that unaccounted-for
   # time will not be paid.
   reminderJob = schedule.scheduleJob '0 13 * * 5', () ->
-    # TODO: This should be a DM
     if not Organization.ready()
-      Logger.log "Don\'t run scheduled payroll reminder, Organization isn\'t ready yet"
+      Logger.log "Don\'t run scheduled payroll reminder,
+                  Organization isn\'t ready yet"
       return
-    robot.sendMessage "Payroll will run on Monday.
-                       Unrecorded time will not be paid"
+    for user in Organization.users
+      user.directMessage "As a reminder, payroll will run on Monday.
+                          Unrecorded time will not be paid.",
+                         Logger

# Author:
#   aaronsky

schedule = require 'node-schedule'

Organization = require('../models/organization').get()

module.exports = (robot) ->
  # Weeks ‘start’ on Sunday morning.
  
  # Every morning, reset hound status for each users

    if not Organization.ready()
      Logger.log "Don\'t run scheduled reset, Organization isn\'t ready yet"
      return
    count = Organization.resetHounding()
    response = "Reset #{count}
                #{if count is 1 then "person's" else "peoples'"}
                hound status for the morning"
    Logger.logToChannel response, 'ibizan-diagnostics'

  # Ibizan will export a Payroll Report every other Sunday night.
  generateReportJob = schedule.scheduleJob '0 17 * * 0', () ->
