Skip to content

Instantly share code, notes, and snippets.

@pippinsplugins
Last active July 26, 2021 09:32
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pippinsplugins/4503579 to your computer and use it in GitHub Desktop.
Save pippinsplugins/4503579 to your computer and use it in GitHub Desktop.
<?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 );
@Arda1601
Copy link

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

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