This repository was archived by the owner on May 21, 2025. It is now read-only.
In our customer notification emails, only display the subscription that is about to renew or expire, don't show all subscriptions purchased in the parent order. #722
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.
Fixes #721
Description
While testing the new Customer Notification feature I noticed that in the table under "Subscription Information", it contained all of my subscriptions that I purchased in the parent/initial order.
For example, I purchased a weekly and an "every 2 days" subscription in the same order, and then processed the "upcoming renewal order" email for just the weekly subscription. When I viewed the email it the subscriptions table contained both of my subscriptions which is not correct:
We don't really have a function available which displays a single subscription info table, therefore this PR introduces a new function to fill this gap. The new
WC_Subscriptions_Email::subscription_details()
function added in this PR is similar to our existingWC_Subscriptions_Email::order_details()
function and can be used to load thesubscriptions-info.php
template for single or multiple subscriptions.How to test this PR
Note
To test customer notifications you will need to either:
return true;
at the top ofshould_send_reminder_email()
, ordefine( 'WP_ENVIRONMENT_TYPE', 'production' );
to yourwp-config.php
fileYou will also need a way to test receiving an email. For testing locally, I just use the
WP Mail Logging
plugin.trunk
, go to the Edit Subscription page for the weekly Subscription and use the actions to run "Send upcoming renewal notification".Product impact