This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

send reminder email when there are remaining tasks

  • Loading branch information...
interstateone committed Nov 1, 2012
1 parent e2b0232 commit 3b159337c1be811427ca6507c3bf5d077b1c3b49
Showing with 3 additions and 3 deletions.
  1. +2 −2 app/models/user.rb
  2. +1 −1 public/js/views/settings.coffee
View
@@ -71,8 +71,8 @@ def send_reminder_email
return unless self.daily_reminder_permission
user_time = Time.now.in_time_zone(self.timezone)
puts "checking #{self.id}"
- unless self.check_today?
- puts "no checks for #{self.id}"
+ if self.remaining_tasks.length > 0
+ puts "remaining tasks for #{self.id}"
if ((user_time.hour == self.daily_reminder_time) && (user_time.min == 0)) || ((user_time.hour == self.daily_reminder_time - 1) && (user_time.min.between?(55,60)))
puts "sending email to #{self.id}"
@@ -42,7 +42,7 @@ define (require) ->
label: _.values(obj)[0]
callback result
daily_reminder_permission:
- title: 'Remind me each day if I haven\'t checked anything off yet'
+ title: 'Remind me each day if I haven\'t completed all tasks'
type: 'Checkbox'
daily_reminder_time:
title: 'Reminder time'

0 comments on commit 3b15933

Please sign in to comment.