Stop relying on instance variables
This commit is contained in:
parent
0d8cb50a30
commit
641f72a517
1 changed files with 7 additions and 7 deletions
|
@ -49,19 +49,19 @@ class NotificationMailer < ApplicationMailer
|
|||
def send_notification(dossier, mail_template)
|
||||
vars_mailer(dossier)
|
||||
|
||||
@subject = mail_template.subject_for_dossier(dossier)
|
||||
@body = mail_template.body_for_dossier(dossier)
|
||||
subject = mail_template.subject_for_dossier(dossier)
|
||||
body = mail_template.body_for_dossier(dossier)
|
||||
|
||||
create_commentaire_for_notification
|
||||
create_commentaire_for_notification(dossier, subject, body)
|
||||
|
||||
mail(subject: @subject) { |format| format.html { @body } }
|
||||
mail(subject: subject) { |format| format.html { body } }
|
||||
end
|
||||
|
||||
def create_commentaire_for_notification
|
||||
def create_commentaire_for_notification(dossier, subject, body)
|
||||
Commentaire.create(
|
||||
dossier: @dossier,
|
||||
dossier: dossier,
|
||||
email: I18n.t("dynamics.contact_email"),
|
||||
body: ["[#{@subject}]", @body].join("<br><br>")
|
||||
body: ["[#{subject}]", body].join("<br><br>")
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue