From 075726e2599879e73f09450ee4e4bd9b9f070ddb Mon Sep 17 00:00:00 2001 From: Marco Almeida Date: Fri, 20 Dec 2024 15:01:51 +0000 Subject: [PATCH 1/3] Add hooks before and after the subscription info table --- templates/emails/subscription-info.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/emails/subscription-info.php b/templates/emails/subscription-info.php index ea619b0e0..bee9641be 100644 --- a/templates/emails/subscription-info.php +++ b/templates/emails/subscription-info.php @@ -4,7 +4,7 @@ * * @author Brent Shepherd / Chuck Mac * @package WooCommerce_Subscriptions/Templates/Emails - * @version 1.0.0 - Migrated from WooCommerce Subscriptions v3.0.4 + * @version 1.1.0 - Migrated from WooCommerce Subscriptions v3.0.4 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly @@ -16,6 +16,9 @@ $has_automatic_renewal = false; $is_parent_order = wcs_order_contains_subscription( $order, 'parent' ); + +do_action( 'wcs_email_before_subscription_info', $subscription, $order, $has_automatic_renewal, $is_parent_order, $sent_to_admin, $plain_text ); + ?>

@@ -74,4 +77,6 @@ } ?>
+ Date: Fri, 20 Dec 2024 15:04:37 +0000 Subject: [PATCH 2/3] Add hooks before and after the subscription info table --- templates/emails/plain/subscription-info.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/emails/plain/subscription-info.php b/templates/emails/plain/subscription-info.php index 001e11747..eb7d434e5 100644 --- a/templates/emails/plain/subscription-info.php +++ b/templates/emails/plain/subscription-info.php @@ -4,7 +4,7 @@ * * @author Brent Shepherd / Chuck Mac * @package WooCommerce_Subscriptions/Templates/Emails - * @version 1.0.0 - Migrated from WooCommerce Subscriptions v3.0.4 + * @version 1.1.0 - Migrated from WooCommerce Subscriptions v3.0.4 */ if ( ! defined( 'ABSPATH' ) ) { @@ -17,6 +17,8 @@ $has_automatic_renewal = false; $is_parent_order = wcs_order_contains_subscription( $order, 'parent' ); +do_action( 'wcs_email_before_subscription_info', $subscriptions, $order, $has_automatic_renewal, $is_parent_order, $sent_to_admin, $plain_text ); + echo "\n\n" . __( 'Subscription information', 'woocommerce-subscriptions' ) . "\n\n"; foreach ( $subscriptions as $subscription ) { $has_automatic_renewal = $has_automatic_renewal || ! $subscription->is_manual(); @@ -61,3 +63,5 @@ ) ); } + +do_action( 'wcs_email_after_subscription_info', $subscriptions, $order, $has_automatic_renewal, $is_parent_order, $sent_to_admin, $plain_text ); From e98c46f8bdf74be35159f0d2054d5006e82ddd91 Mon Sep 17 00:00:00 2001 From: Marco Almeida Date: Fri, 20 Dec 2024 15:06:05 +0000 Subject: [PATCH 3/3] Add hooks before and after the subscription info table Fix variable name from $subscription to $subscriptions --- templates/emails/subscription-info.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/emails/subscription-info.php b/templates/emails/subscription-info.php index bee9641be..7e80300c6 100644 --- a/templates/emails/subscription-info.php +++ b/templates/emails/subscription-info.php @@ -17,7 +17,7 @@ $has_automatic_renewal = false; $is_parent_order = wcs_order_contains_subscription( $order, 'parent' ); -do_action( 'wcs_email_before_subscription_info', $subscription, $order, $has_automatic_renewal, $is_parent_order, $sent_to_admin, $plain_text ); +do_action( 'wcs_email_before_subscription_info', $subscriptions, $order, $has_automatic_renewal, $is_parent_order, $sent_to_admin, $plain_text ); ?>
@@ -79,4 +79,4 @@