37 lines
1,018 B
Ruby
37 lines
1,018 B
Ruby
class GestionnaireMailer < ApplicationMailer
|
|
layout 'mailers/layout'
|
|
|
|
def invite_gestionnaire(gestionnaire, reset_password_token)
|
|
@reset_password_token = reset_password_token
|
|
@gestionnaire = gestionnaire
|
|
subject = "Activez votre compte accompagnateur"
|
|
|
|
mail(to: gestionnaire.email,
|
|
subject: subject,
|
|
reply_to: CONTACT_EMAIL)
|
|
end
|
|
|
|
def user_to_gestionnaire(email)
|
|
@email = email
|
|
subject = "Vous avez été nommé accompagnateur"
|
|
|
|
mail(to: @email, subject: subject)
|
|
end
|
|
|
|
def last_week_overview(gestionnaire)
|
|
email = gestionnaire.email
|
|
@overview = gestionnaire.last_week_overview
|
|
headers['X-mailjet-campaign'] = 'last_week_overview'
|
|
@subject = 'Votre activité hebdomadaire'
|
|
|
|
mail(to: email, subject: @subject)
|
|
end
|
|
|
|
def send_dossier(sender, dossier, recipient)
|
|
@sender = sender
|
|
@dossier = dossier
|
|
subject = "#{sender.email} vous a envoyé le dossier nº #{dossier.id}"
|
|
|
|
mail(to: recipient.email, subject: subject)
|
|
end
|
|
end
|