2018-11-20 11:57:51 +01:00
|
|
|
|
# Preview all emails at http://localhost:3000/rails/mailers/administrateur_mailer
|
2018-04-05 12:36:29 +02:00
|
|
|
|
class AdministrateurMailer < ApplicationMailer
|
|
|
|
|
layout 'mailers/layout'
|
|
|
|
|
|
2019-08-09 16:04:28 +02:00
|
|
|
|
def activate_before_expiration(user, reset_password_token)
|
|
|
|
|
@user = user
|
2018-05-03 18:30:40 +02:00
|
|
|
|
@reset_password_token = reset_password_token
|
2019-08-09 16:04:28 +02:00
|
|
|
|
@expiration_date = @user.reset_password_sent_at + Devise.reset_password_within
|
2021-05-26 15:16:30 +02:00
|
|
|
|
@subject = "N'oubliez pas d’activer votre compte administrateur"
|
2018-05-31 23:58:10 +02:00
|
|
|
|
|
2019-08-09 16:04:28 +02:00
|
|
|
|
mail(to: user.email,
|
2018-09-20 14:34:49 +02:00
|
|
|
|
subject: @subject,
|
|
|
|
|
reply_to: CONTACT_EMAIL)
|
2018-04-05 12:36:29 +02:00
|
|
|
|
end
|
2022-08-16 16:53:41 +02:00
|
|
|
|
|
|
|
|
|
def notify_procedure_expires_when_termine_forced(user_email, procedure)
|
|
|
|
|
@procedure = procedure
|
|
|
|
|
@subject = "La suppression automatique des dossiers a été activée sur la démarche #{procedure.libelle}"
|
|
|
|
|
|
|
|
|
|
mail(to: user_email,
|
|
|
|
|
subject: @subject,
|
|
|
|
|
reply_to: CONTACT_EMAIL)
|
|
|
|
|
end
|
2023-01-23 14:56:05 +01:00
|
|
|
|
|
2023-09-27 11:12:54 +02:00
|
|
|
|
def notify_service_without_siret(user_email)
|
|
|
|
|
@subject = "Siret manquant sur un de vos services"
|
|
|
|
|
|
|
|
|
|
mail(to: user_email,
|
|
|
|
|
subject: @subject,
|
|
|
|
|
reply_to: CONTACT_EMAIL)
|
|
|
|
|
end
|
|
|
|
|
|
2023-03-16 15:36:27 +01:00
|
|
|
|
def api_token_expiration(user, tokens)
|
|
|
|
|
@subject = "Renouvellement de jeton d'API nécessaire"
|
|
|
|
|
@tokens = tokens
|
|
|
|
|
|
|
|
|
|
mail(to: user.email,
|
|
|
|
|
subject: @subject,
|
|
|
|
|
reply_to: CONTACT_EMAIL)
|
|
|
|
|
end
|
|
|
|
|
|
2023-10-18 07:10:26 +02:00
|
|
|
|
def self.critical_email?(action_name)
|
2023-01-23 14:56:05 +01:00
|
|
|
|
action_name == "activate_before_expiration"
|
|
|
|
|
end
|
2018-04-05 12:36:29 +02:00
|
|
|
|
end
|