Send Easy Digital Downloads Subscription Cancellation Email to Admin

This tutorial will show you how to have an automated email sent to a site administrator upon the cancellation of an Easy Digital Downloads (EDD) Recurring Payments Subscription. Note that this assumes you are using Easy Digital Downloads with the Recurring Payments extension.

This need came about when I was working on a project that involved a client that had subscription that had a relatively high churn rate. In this specific instance, there were a few small tasks that needed to be performed when a user cancelled their subscription. By default, the admin was not notified of each cancellation, so it was a bit laborious to keep checking cancelled subscriptions to ensure all proper steps were taken for each cancellation.

The snippet below will send an email to the email address you choose when a subscription is cancelled. It should be added to the functions.php file.

//Send admin email when subscription is cancelled
function wd_cancellation_email( $sub_id, $subscription ) {
	$email_to = '';
	$user_email = $subscription->customer->email;
	$user_name = $subscription->customer->name;
	$subject  = 'EDD Cancellation Email Subject';
	$message  = 'This email confirms that a subsription for ' . $user_name . ' with the email address ' . $user_email . ' has been cancelled.';
	EDD()->emails->send( $email_to, $subject, $message );
add_action( 'edd_subscription_cancelled', 'wd_cancellation_email', 10, 4 );

This action runs each time a subscription is cancelled using the edd_subscription_cancelled action. It creates an email and uses the EDD()->emails->send functionality to send out the email based on the parameters you supply.

You’ll want to change the ‘’ to the email address you’d like the cancellation email sent to. You can also customize the $subject and $message as needed. That’s all there is to it!

Get New Posts in Your Inbox

This field is for validation purposes and should be left unchanged.

About Matt Whiteley

Matt has been building bespoke WordPress websites for over 10 years specializing in the Genesis Framework. He integrates Advanced Custom Fields heavily in all builds, especially with the new Gutenberg Block Editor, allowing clients to easily modify all aspects of the their website with ease.

He works with a wide variety of small businesses and agencies across the country providing development services as well as hosting and maintenance. When he isn't coding he enjoys spending time with his wife and two children, golfing and playing poker.

Reader Interactions


    • Matt Whiteley says

      Hey! I’m not sure exactly. What would they be unsubscribing from? This tutorial goes over the emails when a subscription is cancelled. I’m not sure that you can “unsubscribe” from a subscription.

Leave a Reply

Your email address will not be published.