function wp_privacy_send_personal_data_export_email( $request_id ) { // Get the request.
$request =
wp_get_user_request( $request_id );
if ( !
$request || 'export_personal_data' !==
$request->action_name
) { return new WP_Error( 'invalid_request',
__( 'Invalid request ID when sending personal data export email.'
) );
} // Localize message content for user; fallback to site default for visitors.
if ( !
empty( $request->user_id
) ) { $switched_locale =
switch_to_user_locale( $request->user_id
);
} else { $switched_locale =
switch_to_locale( get_locale() );
} /** This filter is documented in wp-includes/functions.php */
$expiration =
apply_filters( 'wp_privacy_export_expiration', 3 * DAY_IN_SECONDS
);
$expiration_date =
date_i18n( get_option( 'date_format'
),
time() +
$expiration );
$exports_url =
wp_privacy_exports_url();
$export_file_name =
get_post_meta( $request_id, '_export_file_name', true
);
$export_file_url =
$exports_url .
$export_file_name;