Skip to content

Commit

Permalink
Set Reply-To for data breach emails.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Aug 9, 2023
1 parent 0d2fa6c commit 4e86f74
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/data_breach.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def data_breach(report, logged_in_user)
from = MailHandler.address_from_name_and_email(
'WhatDoTheyKnow.com data breach report', blackhole_email
)
set_reply_to_headers(nil, 'Reply-To' => report.contact_email)

# Set a header so we can filter in the mailbox
headers['X-WDTK-Contact'] = 'wdtk-data-breach-report'
Expand Down
1 change: 1 addition & 0 deletions spec/integration/report_a_data_breach_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
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.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')
expect(last_email.body).to include('DPO email: test@example.com')
Expand Down

0 comments on commit 4e86f74

Please sign in to comment.