Put the title in an instance variable when needed to avoid repetition

This commit is contained in:
gregoirenovel 2018-05-31 16:41:58 +02:00
parent 1cd06b68d4
commit dd66089d5c
6 changed files with 8 additions and 8 deletions

View file

@ -5,10 +5,10 @@ class AdministrateurMailer < ApplicationMailer
@administrateur = administrateur
@reset_password_token = reset_password_token
@expiration_date = @administrateur.reset_password_sent_at + Devise.reset_password_within
subject = "N'oubliez pas d'activer votre compte administrateur"
@subject = "N'oubliez pas d'activer votre compte administrateur"
mail(to: administrateur.email,
subject: subject,
subject: @subject,
reply_to: CONTACT_EMAIL)
end
end

View file

@ -22,9 +22,9 @@ class GestionnaireMailer < ApplicationMailer
email = gestionnaire.email
@overview = gestionnaire.last_week_overview
headers['X-mailjet-campaign'] = 'last_week_overview'
subject = 'Votre activité hebdomadaire'
@subject = 'Votre activité hebdomadaire'
mail(to: email, subject: subject)
mail(to: email, subject: @subject)
end
def send_dossier(sender, dossier, recipient)

View file

@ -3,7 +3,7 @@ class UserMailer < ApplicationMailer
def new_account_warning(user)
@user = user
subject = "Création de compte"
@subject = "Demande de création de compte"
mail(to: user.email, subject: subject)
end

View file

@ -1,4 +1,4 @@
- content_for(:title, "N'oubliez pas d'activer votre compte")
- content_for(:title, @subject)
Bonjour,
%br

View file

@ -1,4 +1,4 @@
- content_for(:title, 'Votre activité hebdomadaire')
- content_for(:title, @subject)
- @overview[:procedure_overviews].each_with_index do |procedure_overview, index|

View file

@ -1,4 +1,4 @@
- content_for(:title, 'Demande de création de compte')
- content_for(:title, @subject)
%h1 Bonjour