Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ipokkel/fc24bfd35cc5075e2b0b6e92b2ebb110 to your computer and use it in GitHub Desktop.
Save ipokkel/fc24bfd35cc5075e2b0b6e92b2ebb110 to your computer and use it in GitHub Desktop.
Change the email address for all admin related checkout emails in Paid Memberships Pro.
<?php
/**
* Change the email address for all admin related checkout emails in Paid Memberships Pro.
*
* 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_for_checkout( $user_email, $email ) {
if ( strpos( $email->template, 'checkout_' ) !== false && strpos( $email->template, '_admin' ) !== false ) {
$user_email = 'memberadmin@someemail.co'; // Set recipient email here.
}
return $user_email;
}
add_filter( 'pmpro_email_recipient', 'my_pmpro_change_admin_to_email_for_checkout', 10, 2 );
@ipokkel
Copy link
Author

ipokkel commented Oct 4, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment