Skip to content

Commit

Permalink
Merge pull request #10347 from tchak/cleanup-dossier-user
Browse files Browse the repository at this point in the history
fix(dossier): always use user_email_for instead of user.email
  • Loading branch information
tchak authored Apr 22, 2024
2 parents 761ecf9 + 6644f81 commit 5788997
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
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

0 comments on commit 5788997

Please sign in to comment.