Skip to content

Commit

Permalink
[#10950] Add link in email so use can recreate a dossier
Browse files Browse the repository at this point in the history
  • Loading branch information
mmagn committed Jan 9, 2025
1 parent b246244 commit 331e9db
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/dossier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ def linked_dossiers_for(instructeur_or_expert)
end

def hash_for_deletion_mail
{ id: self.id, procedure_libelle: self.procedure.libelle }
{ id: self.id, procedure_libelle: self.procedure.libelle, procedure_path: self.procedure.path }
end

def geo_data?
Expand Down
3 changes: 1 addition & 2 deletions app/views/dossier_mailer/notify_brouillon_deletion.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
= t('.header', count: @dossier_hashes.size)
%ul
- @dossier_hashes.each do |d|
%li n° #{d[:id]} (#{d[:procedure_libelle]})

%li n° #{d[:id]} (#{link_to d[:procedure_libelle], commencer_url(d[:procedure_path])})
= render partial: "layouts/mailers/signature"
4 changes: 3 additions & 1 deletion spec/mailers/dossier_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ def notify_deletion_to_administration(hidden_dossier, to_email)

it 'verifies subject and body content for brouillon deletion notification' do
expect(subject.subject).to eq("Un dossier en brouillon a été supprimé")
expect(subject.body).to include("n° #{dossier.id} (#{dossier.procedure.libelle})")
expect(subject.body).to include("n° #{dossier.id}")
expect(subject.body).to include(dossier.procedure.libelle)
expect(subject.body).to include(commencer_url(dossier.procedure.path, host: ENV.fetch("APP_HOST_LEGACY")))
end
end

Expand Down

0 comments on commit 331e9db

Please sign in to comment.