From 2f1259709a2c046d3856b7cc1212a741423bc143 Mon Sep 17 00:00:00 2001 From: Lisa Durand Date: Wed, 13 Dec 2023 18:13:08 +0100 Subject: [PATCH] fix email content --- .../send_notification_for_tiers.html.haml | 19 ++++++++++++------- config/locales/views/layouts/mailers/en.yml | 9 +++++++++ config/locales/views/layouts/mailers/fr.yml | 9 +++++++++ spec/mailers/notification_mailer_spec.rb | 2 +- 4 files changed, 31 insertions(+), 8 deletions(-) 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 c96e24011..86f07ee33 100644 --- a/app/views/notification_mailer/send_notification_for_tiers.html.haml +++ b/app/views/notification_mailer/send_notification_for_tiers.html.haml @@ -2,17 +2,22 @@ = render 'layouts/mailers/logo', url: @logo_url %p - Bonjour, + = t("layouts.mailers.for_tiers.good_morning") %p - Nous vous informons que le dossier nº - = number_with_delimiter(@dossier.id) - rempli en votre nom par #{@dossier.mandataire_first_name} - #{@dossier.mandataire_last_name} sur la démarche + = t("layouts.mailers.for_tiers.first_part", + dossier_id: number_with_delimiter(@dossier.id), + mandataire_first_name: @dossier.mandataire_first_name, + mandataire_last_name: @dossier.mandataire_last_name) + %span{ :style => "font-weight: bold;" } = @dossier.procedure.libelle - est passé en phase #{t("instructeurs.dossiers.decisions_rendues_block.without_email.#{@dossier.state}")} le #{l(@dossier.updated_at.to_date)}. -%p= "Pour en savoir plus, veuillez vous rapprocher de #{mail_to(@dossier.user.email)}." + + = t("layouts.mailers.for_tiers.#{@dossier.state}", processed_at: l(@dossier.updated_at.to_date) ) + +%p + = t("layouts.mailers.for_tiers.second_part") + = "#{mail_to(@dossier.user.email)}." %p = t(:best_regards, scope: [:views, :shared, :greetings]) diff --git a/config/locales/views/layouts/mailers/en.yml b/config/locales/views/layouts/mailers/en.yml index 373b4c273..ac65b76d5 100644 --- a/config/locales/views/layouts/mailers/en.yml +++ b/config/locales/views/layouts/mailers/en.yml @@ -14,3 +14,12 @@ en: schedule: "Schedule :" signature: team: "The team" + for_tiers: + good_morning: Good morning, + first_part: We inform you that file no. %{dossier_id}, completed on your behalf by %{mandataire_first_name} %{mandataire_last_name}, on the procedure + second_part: To find out more, please contact + en_construction: has been submited %{processed_at}. + en_instruction: has been received and taken care of on %{processed_at}. The administration is reviewing your file. + accepte: has been accepted on %{processed_at}. + refuse: has been refused on %{processed_at}. + sans_suite: has been closed without continuation on %{processed_at}. diff --git a/config/locales/views/layouts/mailers/fr.yml b/config/locales/views/layouts/mailers/fr.yml index 0c19d0efd..03f5554e9 100644 --- a/config/locales/views/layouts/mailers/fr.yml +++ b/config/locales/views/layouts/mailers/fr.yml @@ -15,3 +15,12 @@ fr: schedule: "Horaires :" signature: team: "L’équipe" + for_tiers: + good_morning: Bonjour, + first_part: Nous vous informons que le dossier nº %{dossier_id}, rempli en votre nom par %{mandataire_first_name} %{mandataire_last_name}, sur la démarche + second_part: Pour en savoir plus, veuillez vous rapprocher de + en_construction: a été déposé le %{processed_at}. + en_instruction: a bien été reçu et pris en charge le %{processed_at}. Il va maintenant être examiné par le service. + accepte: a été accepté le %{processed_at}. + refuse: a été refusé le %{processed_at}. + sans_suite: a été classé sans suite le %{processed_at}. diff --git a/spec/mailers/notification_mailer_spec.rb b/spec/mailers/notification_mailer_spec.rb index 811be3643..44bb32a42 100644 --- a/spec/mailers/notification_mailer_spec.rb +++ b/spec/mailers/notification_mailer_spec.rb @@ -10,7 +10,7 @@ RSpec.describe NotificationMailer, type: :mailer do it { expect(subject.subject).to include("Votre dossier rempli par le mandataire #{dossier_for_tiers.mandataire_first_name} #{dossier_for_tiers.mandataire_last_name} a été mis à jour") } it { expect(subject.to).to eq([dossier_for_tiers.individual.email]) } - it { expect(subject.body).to include("Pour en savoir plus, veuillez vous rapprocher de #{dossier_for_tiers.user.email}.") } + it { expect(subject.body).to include("Pour en savoir plus, veuillez vous rapprocher de\r\n#{dossier_for_tiers.user.email}.") } end describe 'send_en_construction_notification' do