wp_privacy_personal_data_email_headers
云策文档标注
概述
wp_privacy_personal_data_email_headers 是一个 WordPress 过滤器,用于修改个人数据导出文件发送邮件的头部信息。它允许开发者在邮件发送前自定义邮件头,如发件人、回复地址等。
关键要点
- 过滤器名称:wp_privacy_personal_data_email_headers
- 主要用途:过滤个人数据导出邮件的头部,支持自定义邮件头格式
- 参数:包括 $headers(邮件头)、$subject(邮件主题)、$content(邮件内容)、$request_id(请求ID)、$email_data(邮件相关数据)
- 相关函数:wp_privacy_send_personal_data_export_email() 用于发送个人数据导出邮件
- 引入版本:WordPress 5.4.0
注意事项
- 邮件头可以是字符串或数组格式,需确保符合邮件标准
- 使用此过滤器时,应避免破坏邮件发送功能或导致安全漏洞
原文内容
Filters the headers of the email sent with a personal data export file.
Parameters
$headersstring|array-
The email headers.
$subjectstring-
The email subject.
$contentstring-
The email content.
$request_idint-
The request ID.
$email_dataarray-
Data relating to the account action email.
requestWP_User_RequestUser request object.expirationintThe time in seconds until the export file expires.expiration_datestringThe localized date and time when the export file expires.message_recipientstringThe address that the email will be sent to. Defaults to the value of$request->email, but can be changed by thewp_privacy_personal_data_email_tofilter.export_file_urlstringThe export file URL.sitenamestringThe site name sending the mail.siteurlstringThe site URL sending the mail.
Source
$headers = apply_filters( 'wp_privacy_personal_data_email_headers', $headers, $subject, $content, $request_id, $email_data );
Changelog
| Version | Description |
|---|---|
| 5.4.0 | Introduced. |