[Fix #839] Send notification email in async to avoid sending same email to different users

This commit is contained in:
Mathieu Magnin 2017-10-13 17:41:02 +02:00
parent c2ab960ff2
commit 3ba5de88b6

View file

@ -377,7 +377,7 @@ class Dossier < ActiveRecord::Base
def send_notification_email def send_notification_email
if state_changed? && EN_INSTRUCTION.include?(state) if state_changed? && EN_INSTRUCTION.include?(state)
NotificationMailer.send_notification(self, procedure.received_mail_template).deliver_now! NotificationMailer.send_notification(self, procedure.received_mail_template).deliver_later
end end
end end
end end