wp_privacy_personal_data_email_content
Filter HookDescription
Filters the text of the email sent with a personal data export file. 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. to the value of `$request->email`, but can be changed by the `wp_privacy_personal_data_email_to` filter.Hook Information
File Location |
wp-admin/includes/privacy-tools.php
View on GitHub
|
Hook Type | Filter |
Line Number | 704 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$email_text
|
Text in the email. |
int
|
$request_id
|
The request ID for this personal data export. |
array
|
$email_data
|
{ Data relating to the account action email. |
Usage Examples
Basic Usage
<?php
// Hook into wp_privacy_personal_data_email_content
add_filter('wp_privacy_personal_data_email_content', 'my_custom_filter', 10, 3);
function my_custom_filter($email_text, $request_id, $email_data) {
// Your custom filtering logic here
return $email_text;
}
Source Code Context
wp-admin/includes/privacy-tools.php:704
- How this hook is used in WordPress core
<?php
699 * by the `wp_privacy_personal_data_email_to` filter.
700 * @type string $export_file_url The export file URL.
701 * @type string $sitename The site name sending the mail.
702 * @type string $siteurl The site URL sending the mail.
703 */
704 $content = apply_filters( 'wp_privacy_personal_data_email_content', $email_text, $request_id, $email_data );
705
706 $content = str_replace( '###EXPIRATION###', $expiration_date, $content );
707 $content = str_replace( '###LINK###', sanitize_url( $export_file_url ), $content );
708 $content = str_replace( '###EMAIL###', $request_email, $content );
709 $content = str_replace( '###SITENAME###', $site_name, $content );
PHP Documentation
<?php
/**
* Filters the text of the email sent with a personal data export file.
*
* 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.
*
* @since 4.9.6
* @since 5.3.0 Introduced the `$email_data` array.
*
* @param string $email_text Text in the email.
* @param int $request_id The request ID for this personal data export.
* @param array $email_data {
* 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.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-admin/includes/privacy-tools.php
Related Hooks
Related hooks will be displayed here in future updates.