钩子文档

wp_privacy_personal_data_email_content

💡 云策文档标注

概述

wp_privacy_personal_data_email_content 是一个 WordPress 过滤器,用于自定义个人数据导出文件发送邮件的文本内容。它允许开发者动态替换邮件中的特定占位符字符串,如过期日期和文件链接。

关键要点

  • 过滤器名称:wp_privacy_personal_data_email_content
  • 主要用途:过滤个人数据导出邮件的文本内容
  • 动态替换字符串:###EXPIRATION###、###LINK###、###SITENAME###、###SITEURL###
  • 参数:$email_text(邮件文本)、$request_id(请求ID)、$email_data(邮件相关数据数组)
  • 相关函数:wp_privacy_send_personal_data_export_email()
  • 引入版本:WordPress 4.9.6,$email_data 数组在 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.

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.

  • request WP_User_Request
    User request object.
  • expiration int
    The time in seconds until the export file expires.
  • expiration_date string
    The localized date and time when the export file expires.
  • message_recipient string
    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_url string
    The export file URL.
  • sitename string
    The site name sending the mail.
  • siteurl string
    The site URL sending the mail

Source

$content = apply_filters( 'wp_privacy_personal_data_email_content', $email_text, $request_id, $email_data );

Changelog

Version Description
5.3.0 Introduced the $email_data array.
4.9.6 Introduced.