Last active
August 27, 2019 07:41
-
-
Save LMNTL/078f4f4dbb9dcb9e9151e76b9395c867 to your computer and use it in GitHub Desktop.
Send WP new user email and PMPro admin change email after registering a member through a PMPro Zapier zap
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
// send WP new user email and PMPro admin change email after registering a member through a PMPro Zapier zap | |
// requires Paid Memberships Pro and PMPro Zapier add on | |
function my_pmpro_zapier_email_after_change_level( $level_id, $user_id ){ | |
if( isset( $_SERVER["REQUEST_URI"] ) && ( strpos( $_SERVER["REQUEST_URI"], "pmpro_zapier_webhook" ) !== false ) ){ | |
$user = get_userdata( $user_id ); | |
$pmpro_email = new PMProEmail(); | |
$pmpro_email->sendAdminChangeEmail( $user ); | |
wp_new_user_notification( $user_id, null, 'both' ); | |
} | |
} | |
add_action( 'pmpro_after_change_membership_level', 'my_pmpro_zapier_email_after_change_level', 20, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment