Add a variable to improve readability
This commit is contained in:
parent
8eeb10bc5c
commit
a3f5ae9d0b
7 changed files with 30 additions and 14 deletions
|
@ -5,9 +5,10 @@ class AdministrateurMailer < ApplicationMailer
|
||||||
@administrateur = administrateur
|
@administrateur = administrateur
|
||||||
@reset_password_token = reset_password_token
|
@reset_password_token = reset_password_token
|
||||||
@expiration_date = @administrateur.reset_password_sent_at + Devise.reset_password_within
|
@expiration_date = @administrateur.reset_password_sent_at + Devise.reset_password_within
|
||||||
|
subject = "demarches-simplifiees.fr - N'oubliez pas d'activer votre compte administrateur"
|
||||||
|
|
||||||
mail(to: administrateur.email,
|
mail(to: administrateur.email,
|
||||||
subject: "demarches-simplifiees.fr - N'oubliez pas d'activer votre compte administrateur",
|
subject: subject,
|
||||||
reply_to: "contact@demarches-simplifiees.fr")
|
reply_to: "contact@demarches-simplifiees.fr")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,30 +4,35 @@ class AdministrationMailer < ApplicationMailer
|
||||||
def new_admin_email(admin, administration)
|
def new_admin_email(admin, administration)
|
||||||
@admin = admin
|
@admin = admin
|
||||||
@administration = administration
|
@administration = administration
|
||||||
|
subject = "Création d'un compte Admin demarches-simplifiees.fr"
|
||||||
|
|
||||||
mail(to: 'tech@demarches-simplifiees.fr',
|
mail(to: 'tech@demarches-simplifiees.fr',
|
||||||
subject: "Création d'un compte Admin demarches-simplifiees.fr")
|
subject: subject)
|
||||||
end
|
end
|
||||||
|
|
||||||
def invite_admin(admin, reset_password_token)
|
def invite_admin(admin, reset_password_token)
|
||||||
@reset_password_token = reset_password_token
|
@reset_password_token = reset_password_token
|
||||||
@admin = admin
|
@admin = admin
|
||||||
|
subject = "demarches-simplifiees.fr - Activez votre compte administrateur"
|
||||||
|
|
||||||
mail(to: admin.email,
|
mail(to: admin.email,
|
||||||
subject: "demarches-simplifiees.fr - Activez votre compte administrateur",
|
subject: subject,
|
||||||
reply_to: "contact@demarches-simplifiees.fr")
|
reply_to: "contact@demarches-simplifiees.fr")
|
||||||
end
|
end
|
||||||
|
|
||||||
def refuse_admin(admin_email)
|
def refuse_admin(admin_email)
|
||||||
|
subject = "demarches-simplifiees.fr - Votre demande de compte a été refusée"
|
||||||
|
|
||||||
mail(to: admin_email,
|
mail(to: admin_email,
|
||||||
subject: "demarches-simplifiees.fr - Votre demande de compte a été refusée",
|
subject: subject,
|
||||||
reply_to: "contact@demarches-simplifiees.fr")
|
reply_to: "contact@demarches-simplifiees.fr")
|
||||||
end
|
end
|
||||||
|
|
||||||
def dubious_procedures(procedures_and_type_de_champs)
|
def dubious_procedures(procedures_and_type_de_champs)
|
||||||
@procedures_and_type_de_champs = procedures_and_type_de_champs
|
@procedures_and_type_de_champs = procedures_and_type_de_champs
|
||||||
|
subject = "[RGS] De nouvelles procédures comportent des champs interdits"
|
||||||
|
|
||||||
mail(to: 'equipe@demarches-simplifiees.fr',
|
mail(to: 'equipe@demarches-simplifiees.fr',
|
||||||
subject: "[RGS] De nouvelles procédures comportent des champs interdits")
|
subject: subject)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,8 @@ class AvisMailer < ApplicationMailer
|
||||||
def avis_invitation(avis)
|
def avis_invitation(avis)
|
||||||
@avis = avis
|
@avis = avis
|
||||||
email = @avis.gestionnaire&.email || @avis.email
|
email = @avis.gestionnaire&.email || @avis.email
|
||||||
|
subject = "Donnez votre avis sur le dossier nº #{@avis.dossier.id} (#{@avis.dossier.procedure.libelle})"
|
||||||
|
|
||||||
mail(to: email, subject: "Donnez votre avis sur le dossier nº #{@avis.dossier.id} (#{@avis.dossier.procedure.libelle})")
|
mail(to: email, subject: subject)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,13 +3,15 @@ class DossierMailer < ApplicationMailer
|
||||||
|
|
||||||
def notify_deletion_to_user(deleted_dossier, to_email)
|
def notify_deletion_to_user(deleted_dossier, to_email)
|
||||||
@deleted_dossier = deleted_dossier
|
@deleted_dossier = deleted_dossier
|
||||||
|
subject = "Votre dossier n° #{@deleted_dossier.dossier_id} a bien été supprimé"
|
||||||
|
|
||||||
mail(to: to_email, subject: "Votre dossier n° #{@deleted_dossier.dossier_id} a bien été supprimé")
|
mail(to: to_email, subject: subject)
|
||||||
end
|
end
|
||||||
|
|
||||||
def notify_deletion_to_administration(deleted_dossier, to_email)
|
def notify_deletion_to_administration(deleted_dossier, to_email)
|
||||||
@deleted_dossier = deleted_dossier
|
@deleted_dossier = deleted_dossier
|
||||||
|
subject = "Le dossier n° #{@deleted_dossier.dossier_id} a été supprimé à la demande de l'usager"
|
||||||
|
|
||||||
mail(to: to_email, subject: "Le dossier n° #{@deleted_dossier.dossier_id} a été supprimé à la demande de l'usager")
|
mail(to: to_email, subject: subject)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,21 +4,25 @@ class GestionnaireMailer < ApplicationMailer
|
||||||
def invite_gestionnaire(gestionnaire, reset_password_token)
|
def invite_gestionnaire(gestionnaire, reset_password_token)
|
||||||
@reset_password_token = reset_password_token
|
@reset_password_token = reset_password_token
|
||||||
@gestionnaire = gestionnaire
|
@gestionnaire = gestionnaire
|
||||||
|
subject = "demarches-simplifiees.fr - Activez votre compte accompagnateur"
|
||||||
|
|
||||||
mail(to: gestionnaire.email,
|
mail(to: gestionnaire.email,
|
||||||
subject: "demarches-simplifiees.fr - Activez votre compte accompagnateur",
|
subject: subject,
|
||||||
reply_to: "contact@demarches-simplifiees.fr")
|
reply_to: "contact@demarches-simplifiees.fr")
|
||||||
end
|
end
|
||||||
|
|
||||||
def user_to_gestionnaire(email)
|
def user_to_gestionnaire(email)
|
||||||
send_mail(email, nil, "Vous avez été nommé accompagnateur sur demarches-simplifiees.fr")
|
subject = "Vous avez été nommé accompagnateur sur demarches-simplifiees.fr"
|
||||||
|
|
||||||
|
send_mail(email, nil, subject)
|
||||||
end
|
end
|
||||||
|
|
||||||
def last_week_overview(gestionnaire)
|
def last_week_overview(gestionnaire)
|
||||||
headers['X-mailjet-campaign'] = 'last_week_overview'
|
headers['X-mailjet-campaign'] = 'last_week_overview'
|
||||||
overview = gestionnaire.last_week_overview
|
overview = gestionnaire.last_week_overview
|
||||||
|
subject = 'Vos activités sur demarches-simplifiees.fr'
|
||||||
|
|
||||||
send_mail(gestionnaire.email, overview, 'Vos activités sur demarches-simplifiees.fr')
|
send_mail(gestionnaire.email, overview, subject)
|
||||||
end
|
end
|
||||||
|
|
||||||
def send_dossier(sender, dossier, recipient)
|
def send_dossier(sender, dossier, recipient)
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
class InviteMailer < ApplicationMailer
|
class InviteMailer < ApplicationMailer
|
||||||
def invite_user(invite)
|
def invite_user(invite)
|
||||||
vars_mailer(invite)
|
vars_mailer(invite)
|
||||||
|
subject = "demarches-simplifiees.fr - Participez à l'élaboration d'un dossier"
|
||||||
|
|
||||||
send_mail(invite.email, "demarches-simplifiees.fr - Participez à l'élaboration d'un dossier", invite.email_sender) if invite.user.present?
|
send_mail(invite.email, subject, invite.email_sender) if invite.user.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def invite_guest(invite)
|
def invite_guest(invite)
|
||||||
vars_mailer(invite)
|
vars_mailer(invite)
|
||||||
|
subject = "Invitation - #{invite.email_sender} vous invite à consulter un dossier sur demarches-simplifiees.fr"
|
||||||
|
|
||||||
send_mail(invite.email, "Invitation - #{invite.email_sender} vous invite à consulter un dossier sur demarches-simplifiees.fr", invite.email_sender)
|
send_mail(invite.email, subject, invite.email_sender)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -3,7 +3,8 @@ class UserMailer < ApplicationMailer
|
||||||
|
|
||||||
def new_account_warning(user)
|
def new_account_warning(user)
|
||||||
@user = user
|
@user = user
|
||||||
|
subject = "Création de compte"
|
||||||
|
|
||||||
mail(to: user.email, subject: "Création de compte")
|
mail(to: user.email, subject: subject)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue