Created
May 6, 2024 06:39
-
-
Save ipokkel/df69fef67759167cf2cdb30d08fc6242 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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