Last active
September 5, 2024 01:34
-
-
Save pippinsplugins/4503579 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( edd_get_payment_user_email( $payment_id ), $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,
Is this function already send the information sent to the client?
Combine with BACS Plugin (Bank Transfer Gateway) from DaGenius, it seems only send a notification email to administrator.
How can I add the function to send it to the client?
Thanks
ARDA