WordPress.org

Make WordPress Core

Opened 16 months ago

Last modified 9 months ago

#44501 accepted enhancement

Change "From" email address for GDPR request confirmation email

Reported by: zaffarn Owned by: garrett-eclipse
Milestone: Future Release Priority: normal
Severity: normal Version: 4.9.6
Component: Privacy Keywords: needs-patch
Focuses: Cc:
PR Number:

Description

Hi

Is there a way to change the "From" email address for GDPR personal data export request confirmation email, currently when a request is generated through tools -> Export Personal Data, it sends a request confirmation email however the from email is "Wordpress@…" is it possible to change to something like "info@…"

b/w

Change History (4)

#1 @desrosj
16 months ago

  • Keywords reporter-feedback added
  • Type changed from defect (bug) to enhancement

@zaffarn thanks for the ticket, and welcome to Trac!

The from email for privacy related emails is the default email used by wp_mail(). You can filter this email and name using wp_mail_from and wp_mail_from_name respectively.

Can you tell me more about your use case? If you need all other site emails to come from the default address and all privacy emails to come from another, that may be a good instance to look into adding a filter of some sort.

#2 @zaffarn
16 months ago

Hi

Thanks for the swift response, we currently have set "Email address" of wordpress in "Setting - General" as "Info@…" however this works for all other plugins but not this one, this functionality seems to send emails from "Wordpress@…".

With regards to your question are there any uses cases where we may need to use a separate email address, the short answer is yes, normally most automated emails sent by WP can be sent using the generic default email address, however for GDPR request (we) would like to use a different one specifically created for all GDPR requests such as "DPO@…" or "gdpr@…" so that we can keep track of all replies etc easily.

best wishes

This ticket was mentioned in Slack in #core-privacy by desrosj. View the logs.


15 months ago

#4 @garrett-eclipse
9 months ago

  • Keywords needs-patch added; reporter-feedback removed
  • Milestone changed from Awaiting Review to Future Release
  • Owner set to garrett-eclipse
  • Status changed from new to accepted

Hi @zaffarn thank you for the feedback. I definitely see the validity of having the from_email filterable for Privacy requests.

I'm sorry this ticket was raised in our team chat and I missed updating it afterwards.

It was agreed to look into a filter for the reply-to and from email addresses as we felt filtering them specifically would be very helpful for organizations with a DPO as you mentioned.

After reviewing some core implementations it appears the best way to accomplish this would be to introduce the email header as filterable and pass it along to wp_mail. As currently using thewp_mail_from and wp_mail_from_name filters would affect all email since those filters are unaware it's for a privacy request.

Two coding examples of this;
Pass Change Email - https://github.com/WordPress/WordPress/blob/e0c4e5b610bd0453b649f02c514f6eadc059e5be/wp-includes/user.php#L1974-L2011
Email Change Email - https://github.com/WordPress/WordPress/blob/6073c6e209f3877c2d4291f76e3cb3db1c874a99/wp-includes/functions.php#L6342-L6388

I'll look into this further when I have time.

Last edited 9 months ago by garrett-eclipse (previous) (diff)
Note: See TracTickets for help on using tickets.