Class: Course::Assessment::SubmissionQuestion::CommentNotifier

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

Instance Method Summary collapse

Instance Method Details

#post_replied(user, post) ⇒ Object

To be called when user comments on an submission_question.


4
5
6
7
8
9
10
11
12
# File 'app/notifiers/course/assessment/submission_question/comment_notifier.rb', line 4

def post_replied(user, post)
  return unless email_enabled?(post)

  activity = create_activity(actor: user, object: post, event: :replied)
  post.topic.subscriptions.includes(:user).each do |subscription|
    activity.notify(subscription.user, :email) unless subscription.user == user
  end
  activity.save!
end