Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dossier): always use user_email_for instead of user.email #10347

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/mailers/resend_attestation_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion app/models/dossier_transfer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/manager/dossiers/transfer_edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<dt class="attribute-label" id="user">User</dt>

<dd class="attribute-data attribute-data--belongs-to">
<%= link_to @dossier.user.email, manager_user_path(@dossier.user) %>
<%= link_to @dossier.user_email_for(:notification), manager_user_path(@dossier.user) %>
</dd>

<dt class="attribute-label" id="text_summary">Text summary</dt>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
4 changes: 2 additions & 2 deletions app/views/users/dossiers/_dossiers_list.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions app/views/users/dossiers/papertrail.pdf.prawn
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down