2021-11-15 15:38:57 +01:00
|
|
|
class NotifyNewAnswerWithDelayJob < ApplicationJob
|
2021-11-15 16:19:46 +01:00
|
|
|
queue_as :mailers # use default queue for email, same priority
|
2021-11-15 15:38:57 +01:00
|
|
|
|
|
|
|
discard_on ActiveRecord::RecordNotFound
|
|
|
|
|
|
|
|
def perform(dossier, body, commentaire)
|
2021-11-16 14:28:38 +01:00
|
|
|
return if commentaire.discarded?
|
2021-11-15 16:19:46 +01:00
|
|
|
DossierMailer.notify_new_answer(dossier, body).deliver_now
|
2021-11-15 15:38:57 +01:00
|
|
|
end
|
|
|
|
end
|