Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the Cancelled Subscription email to be dispatched twice #787

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

barryhughes
Copy link
Member

We offer merchants email-based notifications when a subscription is cancelled. When enabled, it will be dispatched when a subscription is set to either pending-cancel or cancelled, but not both.

In other words, if a subscription is initially set to pending-cancel (typically, this is the result of the customer self-serving), then the merchant will receive an email. When it then finally ends (when the status is updated to cancelled), the merchant will not receive the same cancellation email a second time.

However, as identified in the linked issue, this is not always desirable and, for some merchants, it may be useful to receive the email twice.

Fixes #771

Description

There are two separate but related changes bundled up in this PR. The first and probably the most important is a change to support optionally sending the Cancelled Subscription email twice:

New setting for the Cancelled Subscription email

Secondly, the Cancelled Subscription email itself has received a small tweak, just to help differentiate between the two different cancellation states. When a subscription is pending cancellation, we say as much and indicate when it will finally end:

Revised text for pending cancellation emails

How to test this PR

When testing, you will require something like Email Log in order to review the emails that are dispatched.

  1. Visit WooCommerce ‣ Settings ‣ Emails and look for the Cancelled Subscription email. Click to manage the settings.
    • Verify that, first time you try this, the new Always Send checkbox is disabled.
    • Please also ensure the email is enabled.
  2. As a customer, purchase a subscription and then visit the My Account ‣ Subscription area. Locate the subscription and cancel it (this sets the subscription to pending-cancel).
    • The cancellation email should have been dispatched.
    • You should see the new wording, as in the above screenshot: A subscription belonging to [name] is pending cancellation, and will end on [date].
  3. As the admin, locate the same subscription in the admin environment and click to Cancel Now. The cancellation email should not be sent a second time.
  4. Still acting as the admin user/merchant, find another active subscription and cancel it. The cancellation email should be dispatched for this other subscription.
  5. Acting as the customer for one of the fully cancelled subscriptions, go ahead and resubscribe ... then cancel again. The cancellation email should be dispatched (this is to ensure we haven't introduced a regression for Cancelled Subscription Emails are not Sending After Reactivation #658).
  6. Now return to the Cancelled Subscription settings. Enable Always Send and save.
  7. Repeat step 2 (results should be the same).
  8. Repeat step 3, but this time the email should be sent a second time.

Product impact

Thoughts and open questions

  • You may also wish to perform testing in which you take advantage of the woocommerce_subscription_use_pending_cancel filter hook (ie, to always skip the pending-cancel status and go straight to cancelled).
  • How do we feel about the changes to the email text—too subtle? Or perhaps not needed?

@barryhughes barryhughes requested review from a team and leonardola and removed request for a team February 19, 2025 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Email type "Expired Subscription" is not being sent
1 participant