Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save JarrydLong/17b55ce6201706d2cb16ba1ca22c033d to your computer and use it in GitHub Desktop.

Select an option

Save JarrydLong/17b55ce6201706d2cb16ba1ca22c033d to your computer and use it in GitHub Desktop.
<?php //do not copy
function my_pmpro_email_headers_email_confirmation( $headers, $email ) {
if( ! function_exists( 'pmproec_isEmailConfirmationLevel' ) ) {
return $headers;
}
// BCC email confirmation emails to another email address
if (
! empty( $email->data['membership_id'] ) &&
pmproec_isEmailConfirmationLevel( $email->data['membership_id'] ) &&
strpos( $email->template, "checkout" ) !== false
) {
$headers[] = 'Bcc:' . 'otheremail@domain.com';
// $headers[] = 'Bcc:' . 'otheremail@domain.com,two@domain.com,three@domain.com'; //Example with multiple BCC emails
}
return $headers;
}
add_filter( 'pmpro_email_headers', 'my_pmpro_email_headers_email_confirmation', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment