NotificationMailer: add send notification

This commit is contained in:
Simon Lehericey 2017-03-05 20:20:29 +01:00
parent 89763ec8d4
commit 65d399b4b0
2 changed files with 19 additions and 0 deletions

View file

@ -2,6 +2,15 @@ class NotificationMailer < ApplicationMailer
default from: 'tps@apientreprise.fr',
to: Proc.new { @user.email }
def send_notification dossier, email
vars_mailer(dossier)
obj = email.object_for_dossier dossier
body = email.body_for_dossier dossier
mail(subject: obj) { |format| format.html { body } }
end
def new_answer dossier
send_mail dossier, "Nouveau message pour votre dossier TPS N°#{dossier.id}"
end