diff --git a/app/mailers/resend_attestation_mailer.rb b/app/mailers/resend_attestation_mailer.rb
index 395eb8062a3..342fdc08ec7 100644
--- a/app/mailers/resend_attestation_mailer.rb
+++ b/app/mailers/resend_attestation_mailer.rb
@@ -2,7 +2,7 @@ class ResendAttestationMailer < ApplicationMailer
include Rails.application.routes.url_helpers
def resend_attestation(dossier)
- to = dossier.user.email
+ to = dossier.user_email_for(:notification)
subject = "Nouvelle attestation pour votre dossier nº #{dossier.id}"
mail(to: to, subject: subject, body: body(dossier))
diff --git a/app/models/dossier_transfer.rb b/app/models/dossier_transfer.rb
index 0783247faf1..83e165cf764 100644
--- a/app/models/dossier_transfer.rb
+++ b/app/models/dossier_transfer.rb
@@ -28,7 +28,7 @@ def self.accept(id, current_user)
DossierTransferLog.create(transfer.dossiers.map do |dossier|
{
dossier: dossier,
- from: dossier.user.email,
+ from: dossier.user_email_for(:notification),
from_support: transfer.from_support,
to: transfer.email
}
diff --git a/app/views/manager/dossiers/transfer_edit.html.erb b/app/views/manager/dossiers/transfer_edit.html.erb
index 7fcb2655556..ab45a4722d5 100644
--- a/app/views/manager/dossiers/transfer_edit.html.erb
+++ b/app/views/manager/dossiers/transfer_edit.html.erb
@@ -12,7 +12,7 @@
User
- <%= link_to @dossier.user.email, manager_user_path(@dossier.user) %>
+ <%= link_to @dossier.user_email_for(:notification), manager_user_path(@dossier.user) %>
Text summary
diff --git a/app/views/notification_mailer/send_notification_for_tiers.html.haml b/app/views/notification_mailer/send_notification_for_tiers.html.haml
index 83c73e69d3a..565c80cc7d0 100644
--- a/app/views/notification_mailer/send_notification_for_tiers.html.haml
+++ b/app/views/notification_mailer/send_notification_for_tiers.html.haml
@@ -22,7 +22,7 @@
%p
= t("layouts.mailers.for_tiers.second_part")
- = "#{mail_to(@dossier.user.email)}."
+ = "#{mail_to(@dossier.user_email_for(:notification))}."
%p
= t(:best_regards, scope: [:views, :shared, :greetings])
diff --git a/app/views/users/dossiers/_dossiers_list.html.haml b/app/views/users/dossiers/_dossiers_list.html.haml
index 8ab0cfa5f70..556f6afc6f3 100644
--- a/app/views/users/dossiers/_dossiers_list.html.haml
+++ b/app/views/users/dossiers/_dossiers_list.html.haml
@@ -79,9 +79,9 @@
- c.with_body do
%p
- if dossier.transfer.from_support?
- = t('views.users.dossiers.transfers.receiver_demande_en_cours_from_support', id: dossier.id, email: dossier.user.email)
+ = t('views.users.dossiers.transfers.receiver_demande_en_cours_from_support', id: dossier.id, email: dossier.user_email_for(:notification))
- else
- = t('views.users.dossiers.transfers.receiver_demande_en_cours', id: dossier.id, email: dossier.user.email)
+ = t('views.users.dossiers.transfers.receiver_demande_en_cours', id: dossier.id, email: dossier.user_email_for(:notification))
%p
= link_to t('views.users.dossiers.transfers.accept'), transfer_path(dossier.transfer), class: "fr-link fr-mr-1w", method: :put
= link_to t('views.users.dossiers.transfers.reject'), transfer_path(dossier.transfer), class: "fr-link", method: :delete
diff --git a/app/views/users/dossiers/papertrail.pdf.prawn b/app/views/users/dossiers/papertrail.pdf.prawn
index 898163eac91..705183dd33a 100644
--- a/app/views/users/dossiers/papertrail.pdf.prawn
+++ b/app/views/users/dossiers/papertrail.pdf.prawn
@@ -52,7 +52,7 @@ prawn_document(margin: [top_margin, right_margin, bottom_margin, left_margin], p
pdf.fill_color grey
pdf.text "#{Individual.human_attribute_name(:prenom)} : #{@dossier.individual.prenom}", size: 10, character_spacing: -0.2, align: :justify
pdf.text "#{Individual.human_attribute_name(:nom)} : #{@dossier.individual.nom.upcase}", size: 10, character_spacing: -0.2, align: :justify
- pdf.text "#{User.human_attribute_name(:email)} : #{@dossier.user.email}", size: 10, character_spacing: -0.2, align: :justify
+ pdf.text "#{User.human_attribute_name(:email)} : #{@dossier.user_email_for(:display)}", size: 10, character_spacing: -0.2, align: :justify
end
end
@@ -61,7 +61,7 @@ prawn_document(margin: [top_margin, right_margin, bottom_margin, left_margin], p
pdf.fill_color grey
pdf.text "Dénomination : " + raison_sociale_or_name(@dossier.etablissement), size: 10, character_spacing: -0.2, align: :justify
pdf.text "SIRET : " + @dossier.etablissement.siret, size: 10, character_spacing: -0.2, align: :justify
- pdf.text "#{User.human_attribute_name(:email)} : #{@dossier.user.email}", size: 10, character_spacing: -0.2, align: :justify
+ pdf.text "#{User.human_attribute_name(:email)} : #{@dossier.user_email_for(:display)}", size: 10, character_spacing: -0.2, align: :justify
end
end