Forked from andrewlimaza/add_password_to_pmpro_checkout_email.php
Last active
May 2, 2022 18:46
-
-
Save kimwhite/d092fe458cf46c540f4da935843852ca to your computer and use it in GitHub Desktop.
Add Password to checkout email for Paid Memberships Pro.
This file contains hidden or 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 | |
/** | |
* Add the user's password to the checkout email for PayPal Express. | |
* Please be sure to take proper precautions when dealing with user's passwords and sending out emails. | |
* This is for demonstrative purposes. | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function add_password_to_pmpro_checkout_email( $body, $email ) { | |
if( $email->template == 'checkout_paid' ){ //add's password field to certain template (Checkout Paid), change template to corresponding template name. | |
$password = $_REQUEST['password']; | |
if( ! empty( $password ) ) { | |
$body .= 'Your password is: ' . $password; | |
} | |
}; | |
return $body; | |
} | |
add_filter( "pmpro_email_body", "add_password_to_pmpro_checkout_email", 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment