diff --git a/lms/djangoapps/course_goals/management/commands/goal_reminder_email.py b/lms/djangoapps/course_goals/management/commands/goal_reminder_email.py index 28c31548e4..7c4fdf59de 100644 --- a/lms/djangoapps/course_goals/management/commands/goal_reminder_email.py +++ b/lms/djangoapps/course_goals/management/commands/goal_reminder_email.py @@ -205,10 +205,10 @@ class Command(BaseCommand): # Essentially, if today is Sunday, days_left_in_week should be 1 since they have Sunday to hit their goal. days_left_in_week = SUNDAY_WEEKDAY - today.weekday() + 1 - # We want to email users in the morning of their timezone + # We want to email users during the day of their timezone user_timezone = get_user_timezone_or_last_seen_timezone_or_utc(goal.user) now_in_users_timezone = datetime.now(user_timezone) - if not 9 <= now_in_users_timezone.hour < 12: + if not 8 <= now_in_users_timezone.hour < 18: return False if required_days_left == days_left_in_week: diff --git a/lms/djangoapps/course_goals/management/commands/tests/test_goal_reminder_email.py b/lms/djangoapps/course_goals/management/commands/tests/test_goal_reminder_email.py index 68372be5eb..ad60420e0d 100644 --- a/lms/djangoapps/course_goals/management/commands/tests/test_goal_reminder_email.py +++ b/lms/djangoapps/course_goals/management/commands/tests/test_goal_reminder_email.py @@ -110,9 +110,9 @@ class TestGoalReminderEmailCommand(TestCase): self.call_command(day=current_day, expect_sent=expect_sent) def test_will_send_at_the_right_time(self): - """ We only send the emails from 9am-12pm in the user's time""" + """ We only send the emails during the day in the user's time""" self.make_valid_goal() - self.call_command(expect_sent=False, time='2021-03-02 8:00:00') + self.call_command(expect_sent=False, time='2021-03-02 6:00:00') self.call_command(expect_sent=True, time='2021-03-02 10:00:00') def test_feature_disabled(self):