demarches-normaliennes/app/mailers/notification_mailer.rb
2015-12-15 11:41:50 +01:00

23 lines
520 B
Ruby

class NotificationMailer < ApplicationMailer
def new_answer dossier
send_mail dossier, "Nouveau commentaire pour votre dossier TPS N°#{dossier.id}"
end
def dossier_validated dossier
send_mail dossier, "Votre dossier TPS N°#{dossier.id} a été validé"
end
private
def vars_mailer dossier
@dossier = dossier
@user = dossier.user
end
def send_mail dossier, subject
vars_mailer dossier
mail(from: "tps@apientreprise.fr", to: @user.email,
subject: subject)
end
end