Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ipokkel/df69fef67759167cf2cdb30d08fc6242 to your computer and use it in GitHub Desktop.
Save ipokkel/df69fef67759167cf2cdb30d08fc6242 to your computer and use it in GitHub Desktop.
<?php
/**
* Change the admin email address for Paid Memberships Pro emails.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpro_change_admin_to_email( $user_email, $email ) {
if ( strpos( $email->template, '_admin' ) !== false || strpos( $email->template, 'admin_approved' ) !== false || strpos( $email->template, 'admin_denied' ) !== false || strpos( $email->template, 'admin_notification_approval' ) !== false ) {
$user_email = 'memberadmin@someemail.co';
}
return $user_email;
}
add_filter( 'pmpro_email_recipient', '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