Skip to content

Instantly share code, notes, and snippets.

@pippinsplugins
Created March 14, 2014 21:10
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pippinsplugins/9557012 to your computer and use it in GitHub Desktop.
Save pippinsplugins/9557012 to your computer and use it in GitHub Desktop.
Send an email anytime a payment is recurring through EDD Recurring Payments
<?php
function pw_edd_recurring_payment_received_notice( $payment, $parent_id, $amount, $txn_id, $unique_key ) {
$user_id = edd_get_payment_user_id( $parent_id );
$email = edd_get_payment_user_email( $parent_id );
$user_data = get_userdata( $user_id );
$subject = 'Payment Received';
$message = "Hello $usera_data->display_name, your payment for $amount has been received. Thanks!";
wp_mail( $email, $subject, $message );
}
add_action( 'edd_recurring_record_payment', 'pw_edd_recurring_payment_received_notice' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment