Created
March 14, 2014 21:10
-
-
Save pippinsplugins/9557012 to your computer and use it in GitHub Desktop.
Send an email anytime a payment is recurring through EDD Recurring Payments
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 | |
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