BCC Additional Email Addresses on Member or Admin Notifications in Paid Memberships Pro

BCC Additional Email Addresses on Member or Admin Notifications in Paid Memberships Pro on child sites.

Snippet Type

Execute on Child Sites

Snippet

function my_pmpro_email_headers_admin_emails( $headers, $email ) {

	// BCC emails already going to admin_email.
	if ( strpos( $email->template, '_admin' ) !== false ) {
		$headers[] = 'Bcc:' . '[email protected]';
	}

	return $headers;
}
add_filter( 'pmpro_email_headers', 'my_pmpro_email_headers_admin_emails', 10, 2 );