demarches-normaliennes/app/mailers/gestionnaire_mailer.rb

24 lines
564 B
Ruby
Raw Normal View History

2016-02-09 11:00:13 +01:00
class GestionnaireMailer < ApplicationMailer
def new_gestionnaire email, password
send_mail email, password, "Vous avez été nommé accompagnateur sur la plateforme TPS"
end
def last_week_overview(gestionnaire, overview)
headers['X-mailjet-campaign'] = 'last_week_overview'
send_mail gestionnaire.email, overview, 'Résumé de la semaine'
end
2016-02-09 11:00:13 +01:00
private
def vars_mailer email, args
@args = args
2016-02-09 11:00:13 +01:00
@email = email
end
def send_mail email, args, subject
vars_mailer email, args
2016-02-09 11:00:13 +01:00
mail(to: email, subject: subject)
2016-02-09 11:00:13 +01:00
end
end