Class: Course::ConsolidatedOpeningReminderNotifier

Inherits:
Notifier::Base
  • Object
show all
Defined in:
app/notifiers/course/consolidated_opening_reminder_notifier.rb

Instance Method Summary collapse

Instance Method Details

#opening_reminder(course) ⇒ Object

Create an opening reminder activity if there are upcoming items for the course.


4
5
6
7
8
9
# File 'app/notifiers/course/consolidated_opening_reminder_notifier.rb', line 4

def opening_reminder(course)
  return if Course::LessonPlan::Item.upcoming_items_from_course_by_type(course).empty?

  create_activity(actor: User.system, object: course, event: :opening_reminder).
    notify(course, :email).save
end