[Fix #1972] Always send mails asynchronously

This commit is contained in:
Frederic Merizen 2018-05-25 18:05:28 +02:00
parent cce00e19c6
commit 07b1c147d9
23 changed files with 45 additions and 32 deletions

View file

@ -55,7 +55,7 @@ class Users::DescriptionController < UsersController
if dossier.brouillon?
dossier.en_construction!
# TODO move to model
NotificationMailer.send_initiated_notification(dossier).deliver_now!
NotificationMailer.send_initiated_notification(dossier).deliver_later
end
flash.notice = 'Félicitations, votre demande a bien été enregistrée.'
redirect_to url_for(controller: :recapitulatif, action: :show, dossier_id: dossier.id)