-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Introduce email_group field in WC_Email
#60665
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
Conversation
📝 WalkthroughWalkthroughAdds a new public property Changes
Sequence Diagram(s)sequenceDiagram
participant AdminUI as Admin UI
participant WC_Email as WC_Email
AdminUI->>WC_Email: get_email_groups()
WC_Email-->>AdminUI: returns groups map (accounts, orders, order-processing, order-exceptions, payments)
note right of AdminUI #e6f7ff: UI uses returned titles to group emails
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (24)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (9)
plugins/woocommerce/includes/emails/class-wc-email-failed-order.php (1)
34-34: Document and add tests for email_group – the base class WC_Email already declarespublic $email_group;(defaults to null) (woocommerce.github.io); add a@var stringPHPDoc above the property for clarity, and include a lightweight unit test asserting each email class’semail_groupto guard against regressions.plugins/woocommerce/includes/emails/class-wc-email-customer-pos-completed-order.php (1)
38-38: Potential inconsistency: POS “Completed order” grouped under “Payments”Non-POS Customer Completed Order is reportedly grouped under “Order processing.” If that’s the intended taxonomy, align this label; otherwise, confirm the difference is deliberate.
Proposed alignment:
- $this->email_group = __( 'Payments', 'woocommerce' ); + $this->email_group = __( 'Order processing', 'woocommerce' );plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-created.php (1)
41-41: Add translator context to the group label.Use
_x()to provide context and avoid ambiguous translations.- $this->email_group = __( 'Order processing', 'woocommerce' ); + $this->email_group = _x( 'Order processing', 'Email group label', 'woocommerce' );plugins/woocommerce/includes/emails/class-wc-email-customer-note.php (1)
40-40: Add translator context to the group label.Consistent with other labels, prefer
_x()with context.- $this->email_group = __( 'Order exceptions', 'woocommerce' ); + $this->email_group = _x( 'Order exceptions', 'Email group label', 'woocommerce' );plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-updated.php (1)
41-41: Add translator context to the group label.- $this->email_group = __( 'Order processing', 'woocommerce' ); + $this->email_group = _x( 'Order processing', 'Email group label', 'woocommerce' );plugins/woocommerce/includes/emails/class-wc-email-customer-processing-order.php (1)
34-34: Add translator context to the group label.- $this->email_group = __( 'Order processing', 'woocommerce' ); + $this->email_group = _x( 'Order processing', 'Email group label', 'woocommerce' );plugins/woocommerce/includes/emails/class-wc-email-cancelled-order.php (1)
34-34: Add translator context to the group label.- $this->email_group = __( 'Orders', 'woocommerce' ); + $this->email_group = _x( 'Orders', 'Email group label', 'woocommerce' );plugins/woocommerce/includes/emails/class-wc-email.php (1)
167-173: Lowercase docblock type + default empty string--- plugins/woocommerce/includes/emails/class-wc-email.php @@ public $email_group; - /** - * Email group. - * - * @var String - */ - public $email_group; + /** + * Email group (localized display label). + * + * @var string + */ + public $email_group = '';Optional: expose a machine-readable group key
public function get_email_group_label(): string { return (string) apply_filters( 'woocommerce_email_group_label', $this->email_group, $this ); } public function get_email_group_key(): string { $key = sanitize_title( wp_strip_all_tags( $this->email_group ) ); return (string) apply_filters( 'woocommerce_email_group_key', $key, $this ); }plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-deleted.php (1)
41-41: Use _x with context for translatable group labelAdd translator context to avoid ambiguous translations across locales.
- $this->email_group = __( 'Order processing', 'woocommerce' ); + $this->email_group = _x( 'Order processing', 'email group', 'woocommerce' );
📜 Review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (20)
plugins/woocommerce/changelog/wooprd-800-add-api-for-notification-listing(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-cancelled-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-cancelled-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-completed-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-failed-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-created.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-deleted.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-updated.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-new-account.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-note.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-on-hold-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-pos-completed-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-pos-refunded-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-processing-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-refunded-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-reset-password.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-failed-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-new-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email.php(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{php,js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/code-quality.mdc)
**/*.{php,js,jsx,ts,tsx}: Guard against unexpected inputs
Sanitize and validate any potentially dangerous inputs
Ensure code is backwards compatible
Write code that is readable and intuitive
Ensure code has unit or E2E tests where applicable
Files:
plugins/woocommerce/includes/emails/class-wc-email.phpplugins/woocommerce/includes/emails/class-wc-email-customer-pos-refunded-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-failed-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-processing-order.phpplugins/woocommerce/includes/emails/class-wc-email-cancelled-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-invoice.phpplugins/woocommerce/includes/emails/class-wc-email-failed-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-updated.phpplugins/woocommerce/includes/emails/class-wc-email-customer-reset-password.phpplugins/woocommerce/includes/emails/class-wc-email-customer-completed-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-refunded-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-new-account.phpplugins/woocommerce/includes/emails/class-wc-email-customer-pos-completed-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-created.phpplugins/woocommerce/includes/emails/class-wc-email-new-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-cancelled-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-on-hold-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-note.phpplugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-deleted.php
**/*.{php,js,ts,jsx,tsx}
⚙️ CodeRabbit configuration file
**/*.{php,js,ts,jsx,tsx}: Don't trust that extension developers will follow the best practices, make sure the code:
- Guards against unexpected inputs.
- Sanitizes and validates any potentially dangerous inputs.
- Is backwards compatible.
- Is readable and intuitive.
- Has unit or E2E tests where applicable.
Files:
plugins/woocommerce/includes/emails/class-wc-email.phpplugins/woocommerce/includes/emails/class-wc-email-customer-pos-refunded-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-failed-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-processing-order.phpplugins/woocommerce/includes/emails/class-wc-email-cancelled-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-invoice.phpplugins/woocommerce/includes/emails/class-wc-email-failed-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-updated.phpplugins/woocommerce/includes/emails/class-wc-email-customer-reset-password.phpplugins/woocommerce/includes/emails/class-wc-email-customer-completed-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-refunded-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-new-account.phpplugins/woocommerce/includes/emails/class-wc-email-customer-pos-completed-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-created.phpplugins/woocommerce/includes/emails/class-wc-email-new-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-cancelled-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-on-hold-order.phpplugins/woocommerce/includes/emails/class-wc-email-customer-note.phpplugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-deleted.php
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (24)
- GitHub Check: Blocks e2e tests 5/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Blocks e2e tests 1/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Core API tests - @woocommerce/plugin-woocommerce [api]
- GitHub Check: Core e2e tests 5/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Blocks e2e tests 4/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: PHP: 8.4 WP: latest [WP latest] 2/2 - @woocommerce/plugin-woocommerce [unit:php]
- GitHub Check: Blocks e2e tests 9/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Core e2e tests 4/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Metrics - @woocommerce/plugin-woocommerce [performance]
- GitHub Check: Core e2e tests 3/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Core e2e tests 2/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: PHP: 7.4 WP: latest - 1 [WP 6.7.3] 2/2 - @woocommerce/plugin-woocommerce [unit:php]
- GitHub Check: Blocks e2e tests 7/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Blocks e2e tests 8/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Blocks e2e tests 3/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Blocks e2e tests 2/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: PHP: 7.4 WP: latest - 1 [WP 6.7.3] 1/2 - @woocommerce/plugin-woocommerce [unit:php]
- GitHub Check: Blocks e2e tests 10/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Core e2e tests 6/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: PHP: 8.4 WP: latest [WP latest] 1/2 - @woocommerce/plugin-woocommerce [unit:php]
- GitHub Check: Core e2e tests 1/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Blocks e2e tests 6/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Lint - @woocommerce/plugin-woocommerce
- GitHub Check: build
🔇 Additional comments (12)
plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php (1)
38-38: email_group = “Payments” fits the Customer Invoice use caseLabel and i18n usage look correct.
plugins/woocommerce/changelog/wooprd-800-add-api-for-notification-listing (1)
1-4: Changelog entry is clear and matches the code changeMinor/add classification is appropriate.
plugins/woocommerce/includes/emails/class-wc-email-new-order.php (1)
34-34: email_group = “Orders” — consistent with admin-facing order notificationsNo issues spotted.
plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-created.php (1)
41-41: No inconsistencies detected in email_group assignments
All email classes use__( '…', 'woocommerce' )consistently, with identical spelling, casing, and whitespace for each group label (‘Orders’, ‘Accounts’, ‘Order exceptions’, ‘Order processing’, ‘Payments’).plugins/woocommerce/includes/emails/class-wc-email-customer-reset-password.php (1)
68-69: LGTM: Group set to “Accounts”.Appropriate use of a localized label for UI grouping.
plugins/woocommerce/includes/emails/class-wc-email-customer-failed-order.php (1)
33-33: LGTM: Group set to “Order exceptions”.Consistent with other “exception” flows.
plugins/woocommerce/includes/emails/class-wc-email-customer-cancelled-order.php (1)
35-35: LGTM: Group set to “Order exceptions”.Matches the intended categorization.
plugins/woocommerce/includes/emails/class-wc-email-customer-refunded-order.php (1)
49-49: LGTM: Group set to “Order exceptions”.Consistent with refund/error scenarios.
plugins/woocommerce/includes/emails/class-wc-email-customer-completed-order.php (1)
33-33: LGTM — correct grouping for Completed OrderMatches the intended “Order processing” category.
plugins/woocommerce/includes/emails/class-wc-email-customer-on-hold-order.php (1)
33-33: LGTM — correct grouping for On-hold Order“Order exceptions” is an appropriate category; consistent with other exception emails.
plugins/woocommerce/includes/emails/class-wc-email-customer-new-account.php (1)
68-68: LGTM — correct grouping for New Account“Accounts” category looks right and keeps customer-account emails together.
plugins/woocommerce/includes/emails/class-wc-email-customer-pos-refunded-order.php (1)
52-52: LGTM — correct grouping for POS Refunded Order“Payments” grouping aligns with invoice/refund notifications.
plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-deleted.php
Outdated
Show resolved
Hide resolved
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. Test this pull request with WordPress Playground. Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit. |
Testing GuidelinesHi @costasovo , Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed. Reminder: PR reviewers are required to document testing performed. This includes:
|
costasovo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks like a straightforward change.
@yuliyan I have a minor concern, though. Maybe I'm overthinking, but I'll share.
There are extensions that add emails. They will also want to specify a group to get to the proper section.
So my concern is that an extension will set a email_group and use `__( 'Orders', 'ext-domain' ); and for some weird reason, it gets translated differently for some languages or not translated at all. Then it may create two different groups for users of that language.
For example, for German, Woo will have Bestellungen but the plugin with a missing translation will fallback to Orders.
We could have some slugs and define groups as an associative array (perhaps in WC_Emails or parent WC_Email) and allow third parties to extend it via a filter. Then we would assign a slugs to the email_group property.
On the other hand, the extenders could probably just use woocommerce as a domain for the translation used in the email_group.
What are your thoughts? Is it an overkill or something we should consider?
|
@costasovo, Thanks for bringing this up - I think your concern is valid. I'll update the PR to use slugs instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (3)
plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-deleted.php (1)
41-41: Verify grouping for “deleted” fulfillment belongs to exceptionsConsider assigning this to 'order-exceptions' (cancellations/deletions are exceptional states), unless design intentionally places it under processing.
Apply if agreed:
- $this->email_group = 'order-processing'; + $this->email_group = 'order-exceptions';plugins/woocommerce/includes/emails/class-wc-email.php (2)
439-462: Use translator context for group titlesPrefer _x with context 'email group' to disambiguate for translators.
public function get_email_groups() { $email_groups = array( - 'accounts' => __( 'Accounts', 'woocommerce' ), - 'orders' => __( 'Orders', 'woocommerce' ), - 'order-processing' => __( 'Order processing', 'woocommerce' ), - 'order-exceptions' => __( 'Order exceptions', 'woocommerce' ), - 'payments' => __( 'Payments', 'woocommerce' ), + 'accounts' => _x( 'Accounts', 'email group', 'woocommerce' ), + 'orders' => _x( 'Orders', 'email group', 'woocommerce' ), + 'order-processing' => _x( 'Order processing', 'email group', 'woocommerce' ), + 'order-exceptions' => _x( 'Order exceptions', 'email group', 'woocommerce' ), + 'payments' => _x( 'Payments', 'email group', 'woocommerce' ), );
439-483: Add minimal unit tests for the new API
- Assert default title fallback with unset group.
- Assert known slug → localized title mapping.
- Assert filters ('woocommerce_email_groups', 'woocommerce_email_group_title') are applied.
I can draft PHPUnit tests under tests/emails/ if you confirm the preferred test location.
📜 Review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (19)
plugins/woocommerce/includes/emails/class-wc-email-cancelled-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-cancelled-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-completed-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-failed-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-created.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-deleted.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-updated.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-new-account.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-note.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-on-hold-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-pos-completed-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-pos-refunded-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-processing-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-refunded-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-customer-reset-password.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-failed-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email-new-order.php(1 hunks)plugins/woocommerce/includes/emails/class-wc-email.php(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (16)
- plugins/woocommerce/includes/emails/class-wc-email-customer-pos-completed-order.php
- plugins/woocommerce/includes/emails/class-wc-email-customer-cancelled-order.php
- plugins/woocommerce/includes/emails/class-wc-email-customer-reset-password.php
- plugins/woocommerce/includes/emails/class-wc-email-customer-refunded-order.php
- plugins/woocommerce/includes/emails/class-wc-email-customer-pos-refunded-order.php
- plugins/woocommerce/includes/emails/class-wc-email-customer-note.php
- plugins/woocommerce/includes/emails/class-wc-email-customer-processing-order.php
- plugins/woocommerce/includes/emails/class-wc-email-customer-on-hold-order.php
- plugins/woocommerce/includes/emails/class-wc-email-cancelled-order.php
- plugins/woocommerce/includes/emails/class-wc-email-customer-completed-order.php
- plugins/woocommerce/includes/emails/class-wc-email-customer-failed-order.php
- plugins/woocommerce/includes/emails/class-wc-email-customer-invoice.php
- plugins/woocommerce/includes/emails/class-wc-email-customer-new-account.php
- plugins/woocommerce/includes/emails/class-wc-email-failed-order.php
- plugins/woocommerce/includes/emails/class-wc-email-new-order.php
- plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-created.php
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{php,js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/code-quality.mdc)
**/*.{php,js,jsx,ts,tsx}: Guard against unexpected inputs
Sanitize and validate any potentially dangerous inputs
Ensure code is backwards compatible
Write code that is readable and intuitive
Ensure code has unit or E2E tests where applicable
Files:
plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-updated.phpplugins/woocommerce/includes/emails/class-wc-email.phpplugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-deleted.php
**/*.{php,js,ts,jsx,tsx}
⚙️ CodeRabbit configuration file
**/*.{php,js,ts,jsx,tsx}: Don't trust that extension developers will follow the best practices, make sure the code:
- Guards against unexpected inputs.
- Sanitizes and validates any potentially dangerous inputs.
- Is backwards compatible.
- Is readable and intuitive.
- Has unit or E2E tests where applicable.
Files:
plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-updated.phpplugins/woocommerce/includes/emails/class-wc-email.phpplugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-deleted.php
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (24)
- GitHub Check: Blocks e2e tests 3/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Blocks e2e tests 9/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Blocks e2e tests 2/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Blocks e2e tests 7/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Core e2e tests 5/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Core e2e tests 6/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Blocks e2e tests 1/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Blocks e2e tests 8/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Blocks e2e tests 4/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Core e2e tests 3/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Blocks e2e tests 5/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Blocks e2e tests 10/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Blocks e2e tests 6/10 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Core API tests - @woocommerce/plugin-woocommerce [api]
- GitHub Check: Metrics - @woocommerce/plugin-woocommerce [performance]
- GitHub Check: PHP: 7.4 WP: latest - 1 [WP 6.7.3] 1/2 - @woocommerce/plugin-woocommerce [unit:php]
- GitHub Check: PHP: 7.4 WP: latest - 1 [WP 6.7.3] 2/2 - @woocommerce/plugin-woocommerce [unit:php]
- GitHub Check: Core e2e tests 4/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Core e2e tests 1/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: Core e2e tests 2/6 - @woocommerce/plugin-woocommerce [e2e]
- GitHub Check: PHP: 8.4 WP: latest [WP latest] 1/2 - @woocommerce/plugin-woocommerce [unit:php]
- GitHub Check: PHP: 8.4 WP: latest [WP latest] 2/2 - @woocommerce/plugin-woocommerce [unit:php]
- GitHub Check: Lint - @woocommerce/plugin-woocommerce
- GitHub Check: build
🔇 Additional comments (2)
plugins/woocommerce/includes/emails/class-wc-email-customer-fulfillment-updated.php (1)
41-41: Set email_group slug: OKUsing the stable slug 'order-processing' is consistent with the base groups and avoids localization leakage into data.
plugins/woocommerce/includes/emails/class-wc-email.php (1)
439-483: Simplify email_group slug coverage check
- Run:
to verify every WC_Email_* class sets one of the allowed slugs.rg -nP --type=php '->email_group\s*=\s*["'"'"'](accounts|orders|order-processing|order-exceptions|payments)["'"'"']' plugins/woocommerce/includes/emails- Run:
to catch any localized assignments.rg -nP --type=php '->email_group\s*=\s*__\(|->email_group\s*=\s*_x\(' plugins/woocommerce/includes/emailsManually inspect any classes not flagged to confirm they correctly define $email_group.
|
@costasovo, I've reworked the PR to use slugs for the |
costasovo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks great! Thank you!
|
Just wondering: What are the email groups used for? This is private, so I can't get that info from here: https://linear.app/a8c/issue/WOOPRD-800/add-api-for-notification-listing |
@webdados, The idea behind email groups is to allow grouping in the UI. Right now, there’s no actual implementation for them in the WooCommerce plugin yet. |
Submission Review Guidelines:
Changes proposed in this Pull Request:
This PR adds a new public field to the
WC_Emailclass$email_groupthat is intended to be used for grouping the email types.Related to WOOPRD-800.
Screenshots or screen recordings:
N/A
How to test the changes in this Pull Request:
Testing that has already taken place:
Changelog entry
Changelog Entry Details
Significance
Type
Message
Changelog Entry Comment
Comment
Introduce
email_groupfield in WC_Email