Use ActiveJob to send comment mails
This commit is contained in:
parent
8392fca0dc
commit
3391d09549
4 changed files with 20 additions and 12 deletions
11
app/jobs/event_comment_mail_job.rb
Normal file
11
app/jobs/event_comment_mail_job.rb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
class EventCommentMailJob < ActiveJob::Base
|
||||
queue_as :default
|
||||
|
||||
def perform(comment)
|
||||
conference = comment.commentable.program.conference
|
||||
|
||||
User.comment_notifiable(conference).each do |user|
|
||||
Mailbot.event_comment_mail(comment, user).deliver_now
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue