Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change Admin "To" address for admin emails [Paid Memberships Pro]
<?php
/**
* Change the "To:" header for admin emails for Paid Memberships Pro.
* Follow this guide to add custom code to your site - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_change_admin_to_email( $headers, $email ){
if( strpos( $email->template, "_admin" ) !== false ) {
//add different email for admin emails.
$headers[] = "To: " . "otheremail@domain.com";
}
return $headers;
}
add_filter( "pmpro_email_headers", "my_pmpro_change_admin_to_email", 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.