demarches-normaliennes/app/mailers/administration_mailer.rb

58 lines
1.7 KiB
Ruby
Raw Normal View History

class AdministrationMailer < ApplicationMailer
layout 'mailers/layout'
def new_admin_email(admin, administration)
2016-02-23 16:51:24 +01:00
@admin = admin
@administration = administration
2018-05-31 15:50:13 +02:00
subject = "Création d'un compte admininistrateur"
2016-02-23 16:51:24 +01:00
2018-05-31 15:43:57 +02:00
mail(to: TECH_EMAIL,
subject: subject)
2016-02-23 16:51:24 +01:00
end
def invite_admin(admin, reset_password_token, administration_id)
2018-01-11 14:17:37 +01:00
@reset_password_token = reset_password_token
@admin = admin
@author_name = BizDev.full_name(administration_id)
subject = "Activez votre compte administrateur"
2018-05-31 23:58:10 +02:00
2018-01-11 14:17:37 +01:00
mail(to: admin.email,
subject: subject,
reply_to: CONTACT_EMAIL)
2018-01-11 14:17:37 +01:00
end
def refuse_admin(admin_email)
subject = "Votre demande de compte a été refusée"
2018-05-31 15:26:02 +02:00
mail(to: admin_email,
subject: subject,
reply_to: CONTACT_EMAIL)
end
def dubious_procedures(procedures_and_type_de_champs)
@procedures_and_type_de_champs = procedures_and_type_de_champs
2018-09-05 14:48:42 +02:00
subject = "[RGS] De nouvelles démarches comportent des champs interdits"
2018-05-31 23:58:10 +02:00
2018-05-31 15:43:57 +02:00
mail(to: EQUIPE_EMAIL,
subject: subject)
end
def dossier_expiration_summary(expiring_dossiers, expired_dossiers)
subject =
if expired_dossiers.present? && expiring_dossiers.present?
"Des dossiers ont dépassé leur délai de conservation, et dautres en approchent"
elsif expired_dossiers.present?
"Des dossiers ont dépassé leur délai de conservation"
elsif expiring_dossiers.present?
"Des dossiers approchent de la fin de leur délai de conservation"
else
"Aucun dossier en fin de délai de conservation"
end
@expiring_dossiers = expiring_dossiers
@expired_dossiers = expired_dossiers
mail(to: TECH_EMAIL, subject: subject)
end
2016-02-23 16:51:24 +01:00
end