<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[51129] trunk: Privacy: Improve naming of user confimed action email filters.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/51129">51129</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/51129","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>antpb</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2021-06-09 01:34:09 +0000 (Wed, 09 Jun 2021)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Privacy: Improve naming of user confimed action email filters.
The filters `user_confirmed_action_email_content`, `user_erasure_complete_email_subject`, and `user_erasure_complete_email_headers` have been deprecated.
They have been replaced with `user_erasure_fulfillment_email_content`, `user_erasure_fulfillment_email_subject`, and `user_erasure_fulfillment_email_headers`.
Props desrosj, garrett-eclipse, birgire, DrewAPicture, lifeforceinst, ocean90, pbiron, pento, coffee2code, TZ-Media, SergeyBiryukov, johnbillion, audrasjb, davidbaumwald, hellofromTonya, helen, xkon, antpb, peterwilsoncc, lukecarbis.
Fixes <a href="https://core.trac.wordpress.org/ticket/44314">#44314</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesprivacytoolsphp">trunk/src/wp-admin/includes/privacy-tools.php</a></li>
<li><a href="#trunksrcwpincludesuserphp">trunk/src/wp-includes/user.php</a></li>
<li><a href="#trunktestsphpunittestsprivacywpPrivacySendErasureFulfillmentNotificationphp">trunk/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php</a></li>
<li><a href="#trunktestsphpunittestsprivacywpPrivacySendRequestConfirmationNotificationphp">trunk/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesprivacytoolsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/privacy-tools.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/privacy-tools.php 2021-06-09 00:19:25 UTC (rev 51128)
+++ trunk/src/wp-admin/includes/privacy-tools.php 2021-06-09 01:34:09 UTC (rev 51129)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -662,7 +662,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: Do not translate EXPIRATION, LINK, SITENAME, SITEURL: those are placeholders. */
</span><span class="cx" style="display: block; padding: 0 10px"> $email_text = __(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'Howdy,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// phpcs:ignore Generic.WhiteSpace.ScopeIndent.Incorrect, PEAR.Functions.FunctionCallSignature.Indent
+'Howdy,
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> Your request for an export of personal data has been completed. You may
</span><span class="cx" style="display: block; padding: 0 10px"> download your personal data by clicking on the link below. For privacy
</span></span></pre></div>
<a id="trunksrcwpincludesuserphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/user.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/user.php 2021-06-09 00:19:25 UTC (rev 51128)
+++ trunk/src/wp-includes/user.php 2021-06-09 01:34:09 UTC (rev 51129)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3646,9 +3646,38 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'admin_email' => $admin_email,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $subject = sprintf(
+ /* translators: Privacy data request confirmed notification email subject. 1: Site title, 2: Name of the confirmed action. */
+ __( '[%1$s] Action Confirmed: %2$s' ),
+ $email_data['sitename'],
+ $action_description
+ );
+
+ /**
+ * Filters the subject of the user request confirmation email.
+ *
+ * @since 4.9.8
+ *
+ * @param string $subject The email subject.
+ * @param string $sitename The name of the site.
+ * @param array $email_data {
+ * Data relating to the account action email.
+ *
+ * @type WP_User_Request $request User request object.
+ * @type string $user_email The email address confirming a request
+ * @type string $description Description of the action being performed so the user knows what the email is for.
+ * @type string $manage_url The link to click manage privacy requests of this type.
+ * @type string $sitename The site name sending the mail.
+ * @type string $siteurl The site URL sending the mail.
+ * @type string $admin_email The administrator email receiving the mail.
+ * }
+ */
+ $subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $email_data['sitename'], $email_data );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: Do not translate SITENAME, USER_EMAIL, DESCRIPTION, MANAGE_URL, SITEURL; those are placeholders. */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $email_text = __(
- 'Howdy,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $content = __(
+// phpcs:ignore Generic.WhiteSpace.ScopeIndent.Incorrect, PEAR.Functions.FunctionCallSignature.Indent
+'Howdy,
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> A user data privacy request has been confirmed on ###SITENAME###:
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3667,7 +3696,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the body of the user request confirmation email.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Use {@see 'user_request_confirmed_email_content'} instead.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * The email is sent to an administrator when an user request is confirmed.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * The following strings have a special meaning and will get replaced dynamically:
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * ###SITENAME### The name of the site.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3676,9 +3708,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * ###MANAGE_URL### The URL to manage requests.
</span><span class="cx" style="display: block; padding: 0 10px"> * ###SITEURL### The URL to the site.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * For fulfillment email content use {@see 'user_erasure_fulfillment_email_content'} instead.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @since 4.9.6
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $email_text Text in the email.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 5.8.0 Use {@see 'user_request_confirmed_email_content'} instead. For fulfillment email content use {@see 'user_erasure_fulfillment_email_content'} instead.
+ *
+ * @param string $content The email content.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $email_data {
</span><span class="cx" style="display: block; padding: 0 10px"> * Data relating to the account action email.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3691,28 +3727,33 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type string $admin_email The administrator email receiving the mail.
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data );
-
- $content = str_replace( '###SITENAME###', $email_data['sitename'], $content );
- $content = str_replace( '###USER_EMAIL###', $email_data['user_email'], $content );
- $content = str_replace( '###DESCRIPTION###', $email_data['description'], $content );
- $content = str_replace( '###MANAGE_URL###', esc_url_raw( $email_data['manage_url'] ), $content );
- $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
-
- $subject = sprintf(
- /* translators: Privacy data request confirmed notification email subject. 1: Site title, 2: Name of the confirmed action. */
- __( '[%1$s] Action Confirmed: %2$s' ),
- $email_data['sitename'],
- $action_description
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $content = apply_filters_deprecated(
+ 'user_confirmed_action_email_content',
+ array( $content, $email_data ),
+ '5.8.0',
+ sprintf(
+ /* translators: 1 & 2: Deprecation replacement options */
+ __( '%1$s or %2$s' ),
+ 'user_request_confirmed_email_content',
+ 'user_erasure_fulfillment_email_content'
+ )
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * Filters the subject of the user request confirmation email.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Filters the body of the user request confirmation email.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 4.9.8
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * The email is sent to an administrator when an user request is confirmed.
+ * The following strings have a special meaning and will get replaced dynamically:
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $subject The email subject.
- * @param string $sitename The name of the site.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * ###SITENAME### The name of the site.
+ * ###USER_EMAIL### The user email for the request.
+ * ###DESCRIPTION### Description of the action being performed so the user knows what the email is for.
+ * ###MANAGE_URL### The URL to manage requests.
+ * ###SITEURL### The URL to the site.
+ *
+ * @since 5.8.0
+ *
+ * @param string $content The email content.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $email_data {
</span><span class="cx" style="display: block; padding: 0 10px"> * Data relating to the account action email.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3725,8 +3766,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type string $admin_email The administrator email receiving the mail.
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $email_data['sitename'], $email_data );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $content = apply_filters( 'user_request_confirmed_email_content', $content, $email_data );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $content = str_replace( '###SITENAME###', $email_data['sitename'], $content );
+ $content = str_replace( '###USER_EMAIL###', $email_data['user_email'], $content );
+ $content = str_replace( '###DESCRIPTION###', $email_data['description'], $content );
+ $content = str_replace( '###MANAGE_URL###', esc_url_raw( $email_data['manage_url'] ), $content );
+ $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $headers = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3817,8 +3864,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the subject of the email sent when an erasure request is completed.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Use {@see 'user_erasure_fulfillment_email_subject'} instead.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @since 4.9.8
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 5.8.0 Use {@see 'user_erasure_fulfillment_email_subject'} instead.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $subject The email subject.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $sitename The name of the site.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $email_data {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3833,13 +3884,34 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type string $siteurl The site URL sending the mail.
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $subject = apply_filters( 'user_erasure_complete_email_subject', $subject, $email_data['sitename'], $email_data );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $subject = apply_filters_deprecated( 'user_erasure_complete_email_subject', array( $subject, $email_data['sitename'], $email_data ), '5.8.0', 'user_erasure_fulfillment_email_subject' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( empty( $email_data['privacy_policy_url'] ) ) {
- /* translators: Do not translate SITENAME, SITEURL; those are placeholders. */
- $email_text = __(
- 'Howdy,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filters the subject of the email sent when an erasure request is completed.
+ *
+ * @since 5.8.0
+ *
+ * @param string $subject The email subject.
+ * @param string $sitename The name of the site.
+ * @param array $email_data {
+ * Data relating to the account action email.
+ *
+ * @type WP_User_Request $request User request object.
+ * @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 `user_erasure_fulfillment_email_to` filter.
+ * @type string $privacy_policy_url Privacy policy URL.
+ * @type string $sitename The site name sending the mail.
+ * @type string $siteurl The site URL sending the mail.
+ * }
+ */
+ $subject = apply_filters( 'user_erasure_fulfillment_email_subject', $subject, $email_data['sitename'], $email_data );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /* translators: Do not translate SITENAME, SITEURL; those are placeholders. */
+ $content = __(
+// phpcs:ignore Generic.WhiteSpace.ScopeIndent.Incorrect, PEAR.Functions.FunctionCallSignature.Indent
+'Howdy,
+
</ins><span class="cx" style="display: block; padding: 0 10px"> Your request to erase your personal data on ###SITENAME### has been completed.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> If you have any follow-up questions or concerns, please contact the site administrator.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3847,11 +3919,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> Regards,
</span><span class="cx" style="display: block; padding: 0 10px"> All at ###SITENAME###
</span><span class="cx" style="display: block; padding: 0 10px"> ###SITEURL###'
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- );
- } else {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ );
+
+ if ( ! empty( $email_data['privacy_policy_url'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: Do not translate SITENAME, SITEURL, PRIVACY_POLICY_URL; those are placeholders. */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $email_text = __(
- 'Howdy,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $content = __(
+// phpcs:ignore Generic.WhiteSpace.ScopeIndent.Incorrect, PEAR.Functions.FunctionCallSignature.Indent
+'Howdy,
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> Your request to erase your personal data on ###SITENAME### has been completed.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3868,6 +3942,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the body of the data erasure fulfillment notification.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Use {@see 'user_erasure_fulfillment_email_content'} instead.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * The email is sent to a user when a their data erasure request is fulfilled
</span><span class="cx" style="display: block; padding: 0 10px"> * by an administrator.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3877,9 +3953,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * ###PRIVACY_POLICY_URL### Privacy policy page URL.
</span><span class="cx" style="display: block; padding: 0 10px"> * ###SITEURL### The URL to the site.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * For user request confirmation email content use {@see 'user_request_confirmed_email_content'} instead.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @since 4.9.6
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $email_text Text in the email.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 5.8.0 Use {@see 'user_erasure_fulfillment_email_content'} instead. For user request confirmation email content use {@see 'user_request_confirmed_email_content'} instead.
+ *
+ * @param string $content The email content.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $email_data {
</span><span class="cx" style="display: block; padding: 0 10px"> * Data relating to the account action email.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3892,8 +3972,47 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type string $siteurl The site URL sending the mail.
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $content = apply_filters_deprecated(
+ 'user_confirmed_action_email_content',
+ array( $content, $email_data ),
+ '5.8.0',
+ sprintf(
+ /* translators: 1 & 2: Deprecation replacement options */
+ __( '%1$s or %2$s' ),
+ 'user_erasure_fulfillment_email_content',
+ 'user_request_confirmed_email_content'
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filters the body of the data erasure fulfillment notification.
+ *
+ * The email is sent to a user when a their data erasure request is fulfilled
+ * by an administrator.
+ *
+ * The following strings have a special meaning and will get replaced dynamically:
+ *
+ * ###SITENAME### The name of the site.
+ * ###PRIVACY_POLICY_URL### Privacy policy page URL.
+ * ###SITEURL### The URL to the site.
+ *
+ * @since 5.8.0
+ *
+ * @param string $content The email content.
+ * @param array $email_data {
+ * Data relating to the account action email.
+ *
+ * @type WP_User_Request $request User request object.
+ * @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 `user_erasure_fulfillment_email_to` filter.
+ * @type string $privacy_policy_url Privacy policy URL.
+ * @type string $sitename The site name sending the mail.
+ * @type string $siteurl The site URL sending the mail.
+ * }
+ */
+ $content = apply_filters( 'user_erasure_fulfillment_email_content', $content, $email_data );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $content = str_replace( '###SITENAME###', $email_data['sitename'], $content );
</span><span class="cx" style="display: block; padding: 0 10px"> $content = str_replace( '###PRIVACY_POLICY_URL###', $email_data['privacy_policy_url'], $content );
</span><span class="cx" style="display: block; padding: 0 10px"> $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3903,8 +4022,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the headers of the data erasure fulfillment notification.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Use {@see 'user_erasure_fulfillment_email_headers'} instead.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @since 5.4.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 5.8.0 Use {@see 'user_erasure_fulfillment_email_headers'} instead.
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string|array $headers The email headers.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $subject The email subject.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $content The email content.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3921,8 +4044,31 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type string $siteurl The site URL sending the mail.
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $headers = apply_filters( 'user_erasure_complete_email_headers', $headers, $subject, $content, $request_id, $email_data );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $headers = apply_filters_deprecated( 'user_erasure_complete_email_headers', array( $headers, $subject, $content, $request_id, $email_data ), '5.8.0', 'user_erasure_fulfillment_email_headers' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filters the headers of the data erasure fulfillment notification.
+ *
+ * @since 5.7.0
+ *
+ * @param string|array $headers The email headers.
+ * @param string $subject The email subject.
+ * @param string $content The email content.
+ * @param int $request_id The request ID.
+ * @param array $email_data {
+ * Data relating to the account action email.
+ *
+ * @type WP_User_Request $request User request object.
+ * @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 `user_erasure_fulfillment_email_to` filter.
+ * @type string $privacy_policy_url Privacy policy URL.
+ * @type string $sitename The site name sending the mail.
+ * @type string $siteurl The site URL sending the mail.
+ * }
+ */
+ $headers = apply_filters( 'user_erasure_fulfillment_email_headers', $headers, $subject, $content, $request_id, $email_data );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $email_sent = wp_mail( $user_email, $subject, $content, $headers );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $switched_locale ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4119,9 +4265,33 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'siteurl' => home_url(),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /* translators: Confirm privacy data request notification email subject. 1: Site title, 2: Name of the action. */
+ $subject = sprintf( __( '[%1$s] Confirm Action: %2$s' ), $email_data['sitename'], $email_data['description'] );
+
+ /**
+ * Filters the subject of the email sent when an account action is attempted.
+ *
+ * @since 4.9.6
+ *
+ * @param string $subject The email subject.
+ * @param string $sitename The name of the site.
+ * @param array $email_data {
+ * Data relating to the account action email.
+ *
+ * @type WP_User_Request $request User request object.
+ * @type string $email The email address this is being sent to.
+ * @type string $description Description of the action being performed so the user knows what the email is for.
+ * @type string $confirm_url The link to click on to confirm the account action.
+ * @type string $sitename The site name sending the mail.
+ * @type string $siteurl The site URL sending the mail.
+ * }
+ */
+ $subject = apply_filters( 'user_request_action_email_subject', $subject, $email_data['sitename'], $email_data );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: Do not translate DESCRIPTION, CONFIRM_URL, SITENAME, SITEURL: those are placeholders. */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $email_text = __(
- 'Howdy,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $content = __(
+// phpcs:ignore Generic.WhiteSpace.ScopeIndent.Incorrect, PEAR.Functions.FunctionCallSignature.Indent
+'Howdy,
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> A request has been made to perform the following action on your account:
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4150,7 +4320,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.9.6
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $email_text Text in the email.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $content Text in the email.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param array $email_data {
</span><span class="cx" style="display: block; padding: 0 10px"> * Data relating to the account action email.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4162,7 +4332,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @type string $siteurl The site URL sending the mail.
</span><span class="cx" style="display: block; padding: 0 10px"> * }
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $content = apply_filters( 'user_request_action_email_content', $email_text, $email_data );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $content = apply_filters( 'user_request_action_email_content', $content, $email_data );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $content = str_replace( '###DESCRIPTION###', $email_data['description'], $content );
</span><span class="cx" style="display: block; padding: 0 10px"> $content = str_replace( '###CONFIRM_URL###', esc_url_raw( $email_data['confirm_url'] ), $content );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4170,29 +4340,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $content = str_replace( '###SITENAME###', $email_data['sitename'], $content );
</span><span class="cx" style="display: block; padding: 0 10px"> $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: Confirm privacy data request notification email subject. 1: Site title, 2: Name of the action. */
- $subject = sprintf( __( '[%1$s] Confirm Action: %2$s' ), $email_data['sitename'], $email_data['description'] );
-
- /**
- * Filters the subject of the email sent when an account action is attempted.
- *
- * @since 4.9.6
- *
- * @param string $subject The email subject.
- * @param string $sitename The name of the site.
- * @param array $email_data {
- * Data relating to the account action email.
- *
- * @type WP_User_Request $request User request object.
- * @type string $email The email address this is being sent to.
- * @type string $description Description of the action being performed so the user knows what the email is for.
- * @type string $confirm_url The link to click on to confirm the account action.
- * @type string $sitename The site name sending the mail.
- * @type string $siteurl The site URL sending the mail.
- * }
- */
- $subject = apply_filters( 'user_request_action_email_subject', $subject, $email_data['sitename'], $email_data );
-
</del><span class="cx" style="display: block; padding: 0 10px"> $headers = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunktestsphpunittestsprivacywpPrivacySendErasureFulfillmentNotificationphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php 2021-06-09 00:19:25 UTC (rev 51128)
+++ trunk/tests/phpunit/tests/privacy/wpPrivacySendErasureFulfillmentNotification.php 2021-06-09 01:34:09 UTC (rev 51129)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -210,7 +210,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 44234
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_email_subject_should_be_filterable() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_filter( 'user_erasure_complete_email_subject', array( $this, 'filter_email_subject' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_filter( 'user_erasure_fulfillment_email_subject', array( $this, 'filter_email_subject' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> _wp_privacy_send_erasure_fulfillment_notification( self::$request_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $mailer = tests_retrieve_phpmailer_instance();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -236,7 +236,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 44234
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_email_body_text_should_be_filterable() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_filter( 'user_confirmed_action_email_content', array( $this, 'filter_email_body_text' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_filter( 'user_erasure_fulfillment_email_content', array( $this, 'filter_email_body_text' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> _wp_privacy_send_erasure_fulfillment_notification( self::$request_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $mailer = tests_retrieve_phpmailer_instance();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -264,7 +264,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @ticket 44501
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function test_email_headers_should_be_filterable() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_filter( 'user_erasure_complete_email_headers', array( $this, 'modify_email_headers' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_filter( 'user_erasure_fulfillment_email_headers', array( $this, 'modify_email_headers' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> _wp_privacy_send_erasure_fulfillment_notification( self::$request_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $mailer = tests_retrieve_phpmailer_instance();
</span></span></pre></div>
<a id="trunktestsphpunittestsprivacywpPrivacySendRequestConfirmationNotificationphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php 2021-06-09 00:19:25 UTC (rev 51128)
+++ trunk/tests/phpunit/tests/privacy/wpPrivacySendRequestConfirmationNotification.php 2021-06-09 01:34:09 UTC (rev 51129)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -178,9 +178,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> _wp_privacy_account_request_confirmed( $request_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_filter( 'user_confirmed_action_email_content', array( $this, 'modify_email_content' ), 10, 2 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_filter( 'user_request_confirmed_email_content', array( $this, 'modify_email_content' ), 10, 2 );
</ins><span class="cx" style="display: block; padding: 0 10px"> _wp_privacy_send_request_confirmation_notification( $request_id );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- remove_filter( 'user_confirmed_action_email_content', array( $this, 'modify_email_content' ), 10 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ remove_filter( 'user_request_confirmed_email_content', array( $this, 'modify_email_content' ), 10 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $mailer = tests_retrieve_phpmailer_instance();
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertContains( 'Custom content containing email address:' . $email, $mailer->get_sent()->body );
</span></span></pre>
</div>
</div>
</body>
</html>