wppaste
WordPress

apply_filters( 'wp_privacy_personal_data_email_content', string $email_text, int $request_id, array $email_data )

Since
4.9.6, 5.3.0
Filters the text of the email sent with a personal data export file.

Description

The following strings have a special meaning and will get replaced dynamically:

  • ###EXPIRATION### The date when the URL will be automatically deleted.
  • ###LINK### URL of the personal data export file for the user.
  • ###SITENAME### The name of the site.
  • ###SITEURL### The URL to the site.

Compatibility

WordPress
since 5.3.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$email_textstring
Text in the email.
$request_idint
The request ID for this personal data export.
$email_dataarray
{ Data relating to the account action email.
@type WP_User_Request $request User request object.
@type int $expiration The time in seconds until the export file expires.
@type string $expiration_date The localized date and time when the export file expires.
@type string $message_recipient The address that the email will be sent to. Defaults to the value of $request->email, but can be changed by the wp_privacy_personal_data_email_to filter.
@type string $export_file_url The export file URL.
@type string $sitename The site name sending the mail.
@type string $siteurl The site URL sending the mail.
  • $requestWP_User_Request

    User request object.
  • $expirationint

    The time in seconds until the export file expires.
  • $expiration_datestring

    The localized date and time when the export file expires.
  • $message_recipientstring

    The address that the email will be sent to. Defaults to the value of $request->email, but can be changed by the wp_privacy_personal_data_email_to filter.
  • $export_file_urlstring

    The export file URL.
  • $sitenamestring

    The site name sending the mail.
  • $siteurlstring

    The site URL sending the mail.

Where this hook fires · 1

  • wp-admin/includes/privacy-tools.php:705wp_privacy_send_personal_data_export_email()

Source code

	 *                                              to the value of `$request->email`, but can be changed	 *                                              by the `wp_privacy_personal_data_email_to` filter.	 *     @type string          $export_file_url   The export file URL.	 *     @type string          $sitename          The site name sending the mail.	 *     @type string          $siteurl           The site URL sending the mail.	 */	$content = apply_filters( 'wp_privacy_personal_data_email_content', $email_text, $request_id, $email_data ); 	$content = str_replace( '###EXPIRATION###', $expiration_date, $content );	$content = str_replace( '###LINK###', sanitize_url( $export_file_url ), $content );	$content = str_replace( '###EMAIL###', $request_email, $content );	$content = str_replace( '###SITENAME###', $site_name, $content );	$content = str_replace( '###SITEURL###', sanitize_url( $site_url ), $content );

Changelog

Introduced in 5.3.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

5.3.0
Introduced the $email_data array.from the docblock
4.9.6
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.9.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.