rcp_email_headers

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' )  ) . "\r\n";

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