[#1972] Avoid passing unsaved templates to ActionMailer

So that all mail arguments can be serialized
This commit is contained in:
Frederic Merizen 2018-05-25 23:08:47 +02:00
parent 1fb85afdc7
commit cce00e19c6
9 changed files with 68 additions and 36 deletions

View file

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