Skip to content

Commit

Permalink
Add a case reference to data breach form
Browse files Browse the repository at this point in the history
Add a unique case reference to the data breach form to prevent incorrect
threading by GMail.

Requires mysociety/alaveteli#7967
Fixes #1774
  • Loading branch information
garethrees authored and gbp committed Oct 26, 2023
1 parent b8c3939 commit f1c0425
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/data_breach.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def data_breach(report, logged_in_user)
mail(
from: from,
to: contact_from_name_and_email,
subject: _('New data breach report'),
subject: _('New data breach report [{{reference}}]',
reference: case_reference('BR'))
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/report_a_data_breach_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
last_email = ActionMailer::Base.deliveries.last
expect(last_email.from).to eq(['do-not-reply-to-this-address@localhost'])
expect(last_email.to).to eq(['postmaster@localhost'])
expect(last_email.subject).to eq('New data breach report')
expect(last_email.subject).to match(/New data breach report \[BR\/.*\]/)
expect(last_email.header["Reply-To"].value).to eq('test@example.com')
expect(last_email.body).to include('URL: https://example.com')
expect(last_email.body).to include('Special category or criminal offence data: Yes')
Expand Down

0 comments on commit f1c0425

Please sign in to comment.