-
-
Save adewaleolaore/4508782 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 | |
function pw_edd_send_email_on_pending( $payment_id, $payment_data ) { | |
// grab the gateway so we can only send on email for specific gateways | |
$gateway = isset( $_POST['edd-gateway'] ) ? $_POST['edd-gateway'] : ''; | |
// TODO: replace "bacs" with your gateway ID | |
if( $gateway != 'bacs' ) | |
return; | |
// TODO: Set your desired subject here | |
$subject = 'New Pending Bank Transfer'; | |
$message = "A new pending transfer has been created.\n\n"; | |
$message .= "From: {$payment_data['user_info']['first_name']} {$payment_data['user_info']['last_name']}\n\n"; | |
$message .= "Email: {$payment_data['user_info']['email']}\n\n"; | |
// $payment_data contains all of the information from the purchase, so add what you want | |
// TODO: set your email address | |
wp_mail( 'email@yourdomain.com', $subject, $message ); | |
} | |
add_action( 'edd_insert_payment', 'pw_edd_send_email_on_pending', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I'm very interesting in your bank transfer methode and the customization for pending transfer with this code.
Would you help me to set it for my website?
It's a crowdfunding website based on donation for young startup.
It will be a great help to make this works.
I'm a newbie in coding.
Thanks
Arda