Class: Course::Survey::ReminderService

Inherits:
Object
  • Object
show all
Includes:
ReminderServiceConcern
Defined in:
app/services/course/survey/reminder_service.rb

Instance Method Summary collapse

Methods included from ReminderServiceConcern

#name_list

Instance Method Details

#closing_reminder(survey, token) ⇒ Object


10
11
12
13
14
# File 'app/services/course/survey/reminder_service.rb', line 10

def closing_reminder(survey, token)
  return unless survey.closing_reminder_token == token && survey.published?
  return unless email_enabled?(survey, :survey_closing)
  send_closing_reminder(survey)
end

#send_closing_reminder(survey) ⇒ Object


16
17
18
19
20
21
# File 'app/services/course/survey/reminder_service.rb', line 16

def send_closing_reminder(survey)
  students = uncompleted_students(survey)
  closing_reminder_students(survey, students)
  closing_reminder_staff(survey, students)
  survey.update_attribute(:closing_reminded_at, Time.zone.now)
end