Merge pull request #10021 from colinux/fix-email-subject-double-encode

ETQ usager je dois voir de vraies apostrophes à la place de `'` dans les sujets d'email
This commit is contained in:
Colin Darie 2024-02-21 08:33:44 +00:00 committed by GitHub
commit 1671a783a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -10,7 +10,7 @@ module MailTemplateConcern
end
def subject_for_dossier(dossier)
replace_tags(subject, dossier).presence || replace_tags(self.class::DEFAULT_SUBJECT, dossier)
replace_tags(subject, dossier, escape: false).presence || replace_tags(self.class::DEFAULT_SUBJECT, dossier, escape: false)
end
def body_for_dossier(dossier)

View file

@ -140,9 +140,9 @@ RSpec.describe NotificationMailer, type: :mailer do
subject(:mail) { described_class.send_en_instruction_notification(dossier) }
context "subject has a special character" do
context "subject has a special character should not be escaped" do
let(:subject) { '--libellé démarche--' }
it { expect(mail.subject).to eq("Mon titre avec l'apostrophe") }
it { expect(mail.subject).to eq("Mon titre avec l'apostrophe") }
end
end
end