rcp_email_headers

Note: This is part of the developer docs and is considered custom code.
Unfortunately, we cannot provide support for custom code at this time as we do not have the additional resources that would be necessary to provide support for custom code.

If you need assistance with this, please reach out to our list of consultants for further assistance:
https://codeable.io/developers/restrict-content-pro/
This filter allows you to modify the email headers in the RCP_Emails class. These headers are then passed into the  wp_mail() function.
Paramters:

$headers (string) – Email headers as a string.

$rcp_email (RCP_Emails) – The emails class.

Here’s an example demonstrating how to BCC the site administrator on all outgoing emails.
function ag_rcp_emails_headers( $headers, $rcp_email ) {
$headers .= sprintf( ‘BCC: %s’, get_bloginfo( ‘admin_email’ ) ) . “rn”;

return $headers;
}
add_filter( ‘rcp_email_headers’, ‘ag_rcp_emails_headers’, 10, 2 );

Have more questions?

Submit a request