Skip to content

Commit 95f88a1

Browse files
authored
Introduce email_group field in WC_Email (#60665)
* Introduce `email_group` field in WC_Email * Add changelog * Use slugs for $email_group property * Fix lint errors and address coderabbitai suggestions
1 parent 02e5695 commit 95f88a1

20 files changed

+75
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: minor
2+
Type: add
3+
4+
Introduce `email_group` field in WC_Email

plugins/woocommerce/includes/emails/class-wc-email-cancelled-order.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class WC_Email_Cancelled_Order extends WC_Email {
3131
public function __construct() {
3232
$this->id = 'cancelled_order';
3333
$this->title = __( 'Cancelled order', 'woocommerce' );
34+
$this->email_group = 'orders';
3435
$this->template_html = 'emails/admin-cancelled-order.php';
3536
$this->template_plain = 'emails/plain/admin-cancelled-order.php';
3637
$this->placeholders = array(

plugins/woocommerce/includes/emails/class-wc-email-customer-cancelled-order.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public function __construct() {
3232
$this->id = 'customer_cancelled_order';
3333
$this->customer_email = true;
3434
$this->title = __( 'Cancelled order', 'woocommerce' );
35+
$this->email_group = 'order-exceptions';
3536
$this->template_html = 'emails/customer-cancelled-order.php';
3637
$this->template_plain = 'emails/plain/customer-cancelled-order.php';
3738
$this->placeholders = array(

plugins/woocommerce/includes/emails/class-wc-email-customer-completed-order.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public function __construct() {
3030
$this->id = 'customer_completed_order';
3131
$this->customer_email = true;
3232
$this->title = __( 'Completed order', 'woocommerce' );
33+
$this->email_group = 'order-processing';
3334
$this->template_html = 'emails/customer-completed-order.php';
3435
$this->template_plain = 'emails/plain/customer-completed-order.php';
3536
$this->placeholders = array(

plugins/woocommerce/includes/emails/class-wc-email-customer-failed-order.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public function __construct() {
3030
$this->id = 'customer_failed_order';
3131
$this->customer_email = true;
3232
$this->title = __( 'Failed order', 'woocommerce' );
33+
$this->email_group = 'order-exceptions';
3334
$this->template_html = 'emails/customer-failed-order.php';
3435
$this->template_plain = 'emails/plain/customer-failed-order.php';
3536
$this->placeholders = array(

plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-created.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function __construct() {
3838
$this->id = 'customer_fulfillment_created';
3939
$this->customer_email = true;
4040
$this->title = __( 'Fulfillment created', 'woocommerce' );
41+
$this->email_group = 'order-processing';
4142
$this->template_html = 'emails/customer-fulfillment-created.php';
4243
$this->template_plain = 'emails/plain/customer-fulfillment-created.php';
4344
$this->placeholders = array(

plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-deleted.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function __construct() {
3838
$this->id = 'customer_fulfillment_deleted';
3939
$this->customer_email = true;
4040
$this->title = __( 'Fulfillment deleted', 'woocommerce' );
41+
$this->email_group = 'order-processing';
4142
$this->template_html = 'emails/customer-fulfillment-deleted.php';
4243
$this->template_plain = 'emails/plain/customer-fulfillment-deleted.php';
4344
$this->placeholders = array(

plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-updated.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function __construct() {
3838
$this->id = 'customer_fulfillment_updated';
3939
$this->customer_email = true;
4040
$this->title = __( 'Fulfillment updated', 'woocommerce' );
41+
$this->email_group = 'order-processing';
4142
$this->template_html = 'emails/customer-fulfillment-updated.php';
4243
$this->template_plain = 'emails/plain/customer-fulfillment-updated.php';
4344
$this->placeholders = array(

plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function __construct() {
3535
$this->id = 'customer_invoice';
3636
$this->customer_email = true;
3737
$this->title = __( 'Order details', 'woocommerce' );
38+
$this->email_group = 'payments';
3839
$this->template_html = 'emails/customer-invoice.php';
3940
$this->template_plain = 'emails/plain/customer-invoice.php';
4041
$this->placeholders = array(

plugins/woocommerce/includes/emails/class-wc-email-customer-new-account.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ public function __construct() {
6565
$this->id = 'customer_new_account';
6666
$this->customer_email = true;
6767
$this->title = __( 'New account', 'woocommerce' );
68+
$this->email_group = 'accounts';
6869
$this->description = __( 'Send an email to customers notifying them that they have created an account', 'woocommerce' );
6970
$this->template_html = 'emails/customer-new-account.php';
7071
$this->template_plain = 'emails/plain/customer-new-account.php';

0 commit comments

Comments
 (0)