[wp-trac] [WordPress Trac] #46303: Update wp_privacy_send_personal_data_export_email to provide the same filters as _wp_privacy_send_erasure_fulfillment_notification

WordPress Trac noreply at wordpress.org
Sat Sep 21 10:04:13 UTC 2019


#46303: Update wp_privacy_send_personal_data_export_email to provide the same
filters as _wp_privacy_send_erasure_fulfillment_notification
-------------------------------------------------+-------------------------
 Reporter:  garrett-eclipse                      |       Owner:  garrett-
                                                 |  eclipse
     Type:  enhancement                          |      Status:  accepted
 Priority:  normal                               |   Milestone:  5.3
Component:  Privacy                              |     Version:  4.9.6
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-dev-  |     Focuses:
  note commit                                    |
-------------------------------------------------+-------------------------
Changes (by birgire):

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


Comment:

 I tested this successfully with a request from {{{user1 at example.com}}} and
 then with a plugin:

 {{{
 <?php
 Plugin Name: Test 46303

 add_filter( 'wp_privacy_personal_data_email_to', function($user_email) {
         return 'user2 at example.com';
 } );

 add_filter( 'wp_privacy_personal_data_email_subject',function($subject ) {
         return 'Test';
 } );

 }}}

 Steps to test:

 - A request is made for {{{user1 at example.com}}}.

 - A verification link is sent to {{{user1 at example.com}}}.

 - {{{user1}}} clicks on verification link in email.

 - Admin sends the export link (clicks the button).

 - The export download link is sent to {{{user2 at example.com}}} emailbox and
 not {{{user1 at example.com}}} emailbox as expected.

 The privacy test group runs successfully.

 ''One should though use the email filter with great care, to avoid sending
 the data export link to wrong emails!
 ''
 ps:

 Just a minor regarding PHPdoc, maybe we should replace:

 {{{
 * @since 5.3.0 Introduced the $email_data array.
 }}}

 with

 {{{
  * @since 5.3.0 Introduced the `$email_data` array.
 }}}

 for the changelog display on https://developer.wordpress.org/reference/

 It took me few seconds though to notice in the test filter, that
 {{{$site_url}}} of {{{$email_data}}} are not value generated within the
 string as it's single quote but not double quote :-)

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


More information about the wp-trac mailing list