Skip to content

Instantly share code, notes, and snippets.

@boluda
Created March 18, 2016 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save boluda/704e6740a9ed3689498e to your computer and use it in GitHub Desktop.
Save boluda/704e6740a9ed3689498e to your computer and use it in GitHub Desktop.
function pw_send_subscription_cancelled_to_admin( $sub_id, $subscription ) {
$email_to = 'your@email.com';
$subject = 'Subscription Cancelled';
$message = 'Subscription cancelled for ' $subscription->customer->email;
EDD()->emails->send( $email_to, $subject, $message );
}
add_action( 'edd_subscription_cancelled', 'pw_send_subscription_cancelled_to_admin', 10, 2 );
function pw_send_subscription_failed_to_admin( $subscription ) {
$email_to = 'your@email.com';
$subject = 'Failed Payment';
$message = 'Failed payment from ' $subscription->customer->email;
EDD()->emails->send( $email_to, $subject, $message );
}
add_action( 'edd_recurring_payment_failed', 'pw_send_subscription_failed_to_admin', 10 );
@mintplugins
Copy link

Hey there, see a fix for a small syntax error with this here:
https://gist.github.com/mintplugins/10948a6b070748063d5e/revisions

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