   findParameters = 
     "jobProfile.updated":
       $lte: @currentTime.toISOString()
-      gt: @beginningOfUTCDay.toISOString()
+      $gt: @beginningOfUTCDay.toISOString()
     "jobProfileApproved": false 
   User.find(findParameters).select("_id jobProfile.name jobProfile.updated").lean().exec cb
   

  
candidateFilter = (candidate, sentEmailFilterCallback) ->
  if candidate.emails?.anyNotes?.enabled is false or candidate.emails?.recruitNotes?.enabled is false
    log.info "Candidate #{candidate.jobProfile.name} opted out of emails, not sending to them."
    return sentEmailFilterCallback true
  findParameters =
    "user": candidate._id

sendwithus = require '../sendwithus'
if config.isProduction or config.redis.host isnt "localhost" #TODO: Ask Nick and Scott to change their environment variables and change the deploy ones
  lockManager = require '../commons/LockManager'
  
module.exports.setup = (app) ->
  app.all config.mail.mailchimpWebhook, handleMailchimpWebHook
  app.get '/mail/cron/ladder-update', handleLadderUpdate
