Make WordPress Core


Ignore:
Timestamp:
02/11/2020 09:41:26 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Privacy: Introduce filters for the headers of all the privacy-related e-mails:

  • wp_privacy_personal_data_email_headers
  • user_request_confirmed_email_headers
  • user_erasure_complete_email_headers
  • user_request_action_email_headers

Props xkon, garrett-eclipse, zaffarn, desrosj.
Fixes #44501.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/privacy-tools.php

    r47278 r47279  
    659659    $content = str_replace( '###SITEURL###', esc_url_raw( $site_url ), $content );
    660660
    661     $mail_success = wp_mail( $request_email, $subject, $content );
     661    $headers = '';
     662
     663    /**
     664     * Filters the headers of the email sent with a personal data export file.
     665     *
     666     * @since 5.4.0
     667     *
     668     * @param string|array $headers    The email headers.
     669     * @param string       $subject    The email subject.
     670     * @param string       $content    The email content.
     671     * @param int          $request_id The request ID.
     672     * @param array        $email_data {
     673     *     Data relating to the account action email.
     674     *
     675     *     @type WP_User_Request $request           User request object.
     676     *     @type int             $expiration        The time in seconds until the export file expires.
     677     *     @type string          $expiration_date   The localized date and time when the export file expires.
     678     *     @type string          $message_recipient The address that the email will be sent to. Defaults
     679     *                                              to the value of `$request->email`, but can be changed
     680     *                                              by the `wp_privacy_personal_data_email_to` filter.
     681     *     @type string          $export_file_url   The export file URL.
     682     *     @type string          $sitename          The site name sending the mail.
     683     *     @type string          $siteurl           The site URL sending the mail.
     684     * }
     685     */
     686    $headers = apply_filters( 'wp_privacy_personal_data_email_headers', $headers, $subject, $content, $request_id, $email_data );
     687
     688    $mail_success = wp_mail( $request_email, $subject, $content, $headers );
    662689
    663690    if ( $switched_locale ) {
Note: See TracChangeset for help on using the changeset viewer.