Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Reply-To for data breach emails. #1768

Merged
merged 1 commit into from
Aug 25, 2023
Merged

Conversation

dracos
Copy link
Member

@dracos dracos commented Aug 9, 2023

Fixes #1767

@dracos dracos requested a review from chrismytton August 9, 2023 17:00
@@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The contact_email field is optional, so we won't necessarily have an email address in report.contact_email.

We might also have a logged_in_user, so perhaps want to pass in the logged_in_user as the first argument, and then if there's an email address in contact_email, pass that in as the reply-to header?

Not sure exactly how the blackhole stuff works inside set_reply_to_headers, @gbp may be able to give more detailed guidance 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, swear I'd put an if in! Going mad.
The form asks for DPO email, not user's email, so presumed didn't want to involve the logged-in user at all in this, but, yes it certainly could do if desired.
I assumed the envelope was set to the From (which is blackhole in this case) by default in the absence of being set, so that wouldn't be changing anything.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes on reflection I think you're right, best to leave the logged in user out of this.

@mysociety-pusher mysociety-pusher merged commit 038c621 into master Aug 25, 2023
5 checks passed
@mysociety-pusher mysociety-pusher deleted the 1767-breach-reply-to branch August 25, 2023 08:50
@garethrees
Copy link
Member

Thanks both!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data breach form does not set reply-to header
4 participants