diff --git a/app/mailers/notification_mailer.rb b/app/mailers/notification_mailer.rb index 9d39aff0f..7d803b9cf 100644 --- a/app/mailers/notification_mailer.rb +++ b/app/mailers/notification_mailer.rb @@ -1,8 +1,6 @@ class NotificationMailer < ApplicationMailer default to: Proc.new { @user.email } - after_action :create_commentaire_for_notification, only: [:send_notification, :send_dossier_received] - def send_dossier_received(dossier_id) dossier = Dossier.find(dossier_id) send_notification(dossier, dossier.procedure.received_mail_template) @@ -44,6 +42,8 @@ class NotificationMailer < ApplicationMailer @subject = mail_template.subject_for_dossier dossier @body = mail_template.body_for_dossier dossier + create_commentaire_for_notification + mail(subject: @subject) { |format| format.html { @body } } end