[wp-trac] [WordPress Trac] #44501: Change "From" email address for GDPR request confirmation email

WordPress Trac noreply at wordpress.org
Sat Jan 25 13:13:55 UTC 2020


#44501: Change "From" email address for GDPR request confirmation email
-------------------------------------------------+-------------------------
 Reporter:  zaffarn                              |       Owner:  xkon
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  5.4
Component:  Privacy                              |     Version:  4.9.6
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing needs-dev-   |     Focuses:
  note needs-unit-tests                          |
-------------------------------------------------+-------------------------
Changes (by xkon):

 * keywords:  needs-patch => has-patch needs-testing needs-dev-note needs-
     unit-tests


Comment:

 [attachment:"44501.diff"] introduces 4 new hooks to allow the filtering of
 all the privacy-related e-mails.

 It will now be possible to change the From addresses on these emails as
 it's common to have a different address for DPO purposes.

 All filters contain equal data and an easy way to test would be:
 {{{
 <?php

 function my_privacy_mail_headers( $headers, $subject, $content,
 $request_id, $email_data ) {

         $headers = array(
                 'From: My Name <myname at example.com>',
         );

         return $headers;
 }
 add_filter( 'user_request_action_email_headers',
 'my_privacy_mail_headers', 10, 5 );
 add_filter( 'user_request_confirmed_email_headers',
 'my_privacy_mail_headers', 10, 5 );
 add_filter( 'user_erasure_complete_email_headers',
 'my_privacy_mail_headers', 10, 5 );
 add_filter( 'wp_privacy_personal_data_email_headers',
 'my_privacy_mail_headers', 10, 5 );
 }}}

 I'll be looking into adding unit tests also asap.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44501#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list