Allow the Cancelled Subscription email to be dispatched twice #787
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
orcancelled
, 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 tocancelled
), 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:
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:
How to test this PR
When testing, you will require something like Email Log in order to review the emails that are dispatched.
pending-cancel
).Cancel Now
. The cancellation email should not be sent a second time.Product impact
Thoughts and open questions
woocommerce_subscription_use_pending_cancel
filter hook (ie, to always skip thepending-cancel
status and go straight tocancelled
).