Skip to content

Add reset notification email content#63558

Merged
triple0t merged 5 commits intotrunkfrom
wooprd-1019-add-reset-notification-email-content
Mar 9, 2026
Merged

Add reset notification email content#63558
triple0t merged 5 commits intotrunkfrom
wooprd-1019-add-reset-notification-email-content

Conversation

@triple0t
Copy link
Copy Markdown
Contributor

@triple0t triple0t commented Mar 5, 2026

Submission Review Guidelines:

Changes proposed in this Pull Request:

Closes #WOOPRD-1019.

Adds a "Reset content to default" action to the WooCommerce email editor, allowing users to reset a notification email's block content to the original plugin-distributed state.

What changed:

  • New entity action (reset-notification-email-content.tsx): Registers a woo_email-specific action via registerEntityAction. Shows a confirmation modal, fetches the original template content from the API, then calls editEntityRecord + saveEditedEntityRecord to reset and persist the content.
  • New REST endpoint (EmailApiController::register_routes()): GET /woocommerce-email-editor/v1/emails/{id}/default-content — returns the plugin-distributed block template for a given woo_email post. Registered on-demand (not as a REST field) to avoid an expensive filesystem read on every post fetch.
  • Email editor package exports (packages/js/email-editor/src/index.ts): Exports registerEntityAction and PostWithPermissions from the package's public API so WooCommerce (and other integrators) can consume them without accessing private APIs directly.

Note: We used the woocommerce-email-editor/v1 namespace because it is always available (registered unconditionally by the email editor PHP package), unlike wc/v4, which is feature-flagged.

Screenshots or screen recordings:

Before After
Screenshot 2026-03-05 at 3 56 59 PM Screenshot 2026-03-05 at 3 35 37 PM

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Enable the block email editor at WooCommerce → Settings → Advanced → Features.
  2. Go to WooCommerce → Settings → Emails and click "Edit" on any notification email (e.g. New Order).
  3. Make some edits to the email content and save.
  4. Open the three-dot (⋮) menu in the top-right of the editor toolbar.
  5. Confirm the "Reset content to default" action is present in the list.
  6. Click it — a confirmation modal should appear with the email's title.
  7. Click "Reset to default" — the editor content should update to the original plugin template and a success snackbar should appear.
  8. Verify the network tab shows a GET /wp-json/woocommerce-email-editor/v1/emails/{id}/default-content request fired only when confirming the reset (not on page load).
  9. Click "Cancel" in the modal — no changes should be made.
  10. Repeat for an email where you do not have manage_woocommerce capability — the action should not appear.

Testing that has already taken place:

Milestone

Note: Check the box above to have the milestone automatically assigned when merged.
Alternatively (e.g. for point releases), manually assign the appropriate milestone.

Changelog entry

  • Automatically create a changelog entry from the details below.
  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Changelog Entry Comment

Comment

triple0t added 2 commits March 5, 2026 15:40
  Registers a "Reset content to default" entity action for woo_email posts
  in the email editor. When triggered, it fetches the original plugin-
  distributed block template content via a new REST endpoint and restores
  the post content to that default state.

  - Add GET /woocommerce-email-editor/v1/emails/{id}/default-content endpoint
  - Export registerEntityAction and PostWithPermissions from email editor package
  - Register reset action for woo_email post type from email-editor-integration
…for WordPress 6.7 (Woo has discontinued it).
@triple0t triple0t requested a review from a team as a code owner March 5, 2026 14:57
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 5, 2026

Testing Guidelines

Hi @lysyjan ,

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:

  • 🖼️ Screenshots or screen recordings.
  • 📝 List of functionality tested / steps followed.
  • 🌐 Site details (environment attributes such as hosting type, plugins, theme, store size, store age, and relevant settings).
  • 🔍 Any analysis performed, such as assessing potential impacts on environment attributes and other plugins, conducting performance profiling, or using LLM/AI-based analysis.

⚠️ Within the testing details you provide, please ensure that no sensitive information (such as API keys, passwords, user data, etc.) is included in this public issue.

@github-actions github-actions Bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Mar 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 5, 2026

Size Change: +3.17 kB (+0.05%)

Total Size: 5.98 MB

Filename Size Change
./packages/js/email-editor/build/index.js 4.97 kB +179 B (+3.73%)
./plugins/woocommerce/client/admin/build/email-editor/index.js 41.8 kB +205 B (+0.49%)
./plugins/woocommerce/client/admin/build/wp-admin-scripts/email-editor-integration.js 44.7 kB +850 B (+1.94%)
./plugins/woocommerce/client/blocks/build/cart-rtl.css 8.7 kB +569 B (+6.99%) 🔍
./plugins/woocommerce/client/blocks/build/cart.css 8.7 kB +565 B (+6.95%) 🔍
./plugins/woocommerce/client/blocks/build/wc-cart-checkout-base-frontend.js 61.9 kB +624 B (+1.02%)

compressed-size-action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 5, 2026

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 69c042b9-c110-41c1-a7a7-a343186f48dd

📥 Commits

Reviewing files that changed from the base of the PR and between 4b4f452 and 833c8f9.

📒 Files selected for processing (2)
  • plugins/woocommerce/src/Internal/EmailEditor/EmailApiController.php
  • plugins/woocommerce/tests/php/src/Internal/EmailEditor/EmailApiControllerTest.php
✅ Files skipped from review due to trivial changes (1)
  • plugins/woocommerce/tests/php/src/Internal/EmailEditor/EmailApiControllerTest.php

📝 Walkthrough

Walkthrough

Adds a reset-notification-email-content entity action (frontend UI), a backend REST endpoint to fetch plugin-default email content, and new exports from the email-editor package: registerEntityAction, unregisterEntityAction, and PostWithPermissions.

Changes

Cohort / File(s) Summary
Email Editor Package Exports
packages/js/email-editor/changelog/wooprd-1019-export-register-entity-action, packages/js/email-editor/src/index.ts
Exported registerEntityAction, unregisterEntityAction from private APIs and added PostWithPermissions to exported types.
WooCommerce Changelog
plugins/woocommerce/changelog/wooprd-1019-add-reset-notification-email-content
Added changelog entry documenting the new reset-notification-email-content action.
Admin Integration (registration)
plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/index.ts
Imports registerEntityAction and registers the reset action for woo_email via a core.registerPostTypeSchema hook.
Reset Action Implementation (frontend)
plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/reset-notification-email-content.tsx
New getResetNotificationEmailContentAction() returning an entity action with eligibility check, confirmation modal UI, API call to fetch default content, block parsing, editor state update, save flow, and success/error notifications.
Backend REST API
plugins/woocommerce/src/Internal/EmailEditor/EmailApiController.php, plugins/woocommerce/src/Internal/EmailEditor/Integration.php
Added register_routes(), get_default_content_schema(), and get_default_content_response(); registered route woocommerce-email-editor/v1/emails/{id}/default-content and integrated WCTransactionalEmailPostsGenerator to return plugin-generated default content with permissions.
PHP Tests
plugins/woocommerce/tests/php/src/Internal/EmailEditor/EmailApiControllerTest.php
Added tests for default-content endpoint: 404 for unknown post and successful content retrieval for valid post (mocks WCTransactionalEmailPostsGenerator).

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Modal as Reset Modal UI
    participant Editor as Email Editor Store
    participant API as REST API
    participant Generator as WCTransactionalEmailPostsGenerator

    User->>Modal: Trigger reset action
    Modal->>Modal: Show confirmation dialog
    User->>Modal: Confirm reset
    Modal->>API: GET /woocommerce-email-editor/v1/emails/{id}/default-content
    API->>Generator: Request generated default content for ID
    Generator-->>API: Return default blocks/content
    API-->>Modal: Return default content
    Modal->>Editor: Parse blocks and update editor state
    Modal->>Editor: Save updated entity
    Editor-->>Modal: Save complete
    Modal->>User: Show success notice and close
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'Add reset notification email content' clearly and concisely summarizes the main feature being added to the email editor system.
Description check ✅ Passed The PR description thoroughly explains the changes, including what was added (entity action, REST endpoint, package exports) and why, with detailed testing instructions.
Docstring Coverage ✅ Passed Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch wooprd-1019-add-reset-notification-email-content

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a 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 (3)
plugins/woocommerce/src/Internal/EmailEditor/EmailApiController.php (2)

306-309: Use DI for WCTransactionalEmailPostsGenerator instead of direct instantiation.

Creating the generator with new here bypasses container wiring and makes this path harder to mock and standardize with the rest of Internal services.

♻️ Proposed refactor
-		$generator = new WCTransactionalEmailPostsGenerator();
+		$generator = wc_get_container()->get( WCTransactionalEmailPostsGenerator::class );

As per coding guidelines "Dependencies in PHP classes should be injected via the DI container using the init() method pattern."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/woocommerce/src/Internal/EmailEditor/EmailApiController.php` around
lines 306 - 309, Replace the direct instantiation of
WCTransactionalEmailPostsGenerator with the DI/init() pattern used by the
codebase: obtain the generator via the controller's dependency initializer (e.g.
$this->init(WCTransactionalEmailPostsGenerator::class) or the equivalent
container accessor used elsewhere in EmailApiController) and use that instance
in place of new WCTransactionalEmailPostsGenerator(); update the method that
returns WP_REST_Response to call get_email_template on the injected instance so
the generator can be mocked and container-wired consistently.

257-277: Add REST API tests for the new default-content route.

Please add coverage for permission denied, unknown post ID (404), and successful payload shape (content).

Based on learnings: "For REST API controller tests in plugins/woocommerce/tests/**/*.php, test classes should extend WC_REST_Unit_Test_Case because REST routes need to be registered before tests run."

Also applies to: 285-311

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/woocommerce/src/Internal/EmailEditor/EmailApiController.php` around
lines 257 - 277, Add REST API tests for the new route registered by
register_routes (route: 'woocommerce-email-editor/v1' path
'/emails/(?P<id>\d+)/default-content', handler get_default_content_response'):
create a test class that extends WC_REST_Unit_Test_Case, ensure routes are
registered in setUp, then add three tests: (1) permission_denied: set current
user without manage_woocommerce capability, dispatch a GET WP_REST_Request to
the endpoint for an existing or arbitrary ID and assert a 403 response; (2)
unknown_post_id_returns_404: ensure no post exists for an ID (or use an
obviously invalid ID), dispatch GET and assert 404; (3)
successful_payload_shape: create a woo_email post (the post type used by the
controller), set a user with manage_woocommerce, dispatch GET for that post ID
and assert 200 and that the response data contains a 'content' field with the
expected structure/value; use rest_do_request / WP_REST_Request to call the
route and standard PHPUnit assertions for status and response data.
plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/reset-notification-email-content.tsx (1)

38-183: Add tests for reset success/error behavior.

This new action path now includes API fetch, record mutation, persistence, and snackbar outcomes; it should have focused unit/E2E coverage for confirm-only fetch, success notice, and error notice paths.

As per coding guidelines "Add unit or E2E tests where applicable."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/reset-notification-email-content.tsx`
around lines 38 - 183, Add unit/E2E tests for
getResetNotificationEmailContentAction covering the three paths: successful
reset, API error, and confirm-only fetch. Specifically, write tests that stub
apiFetch to return default content (assert parse/serialize flow, that
editEntityRecord and saveEditedEntityRecord are called with expected args and
createSuccessNotice is invoked with the snackbar id
'reset-notification-email-content-action'), stub apiFetch to throw (assert
createErrorNotice is called with the error message), and verify the confirm-only
UI path (modal opens, Cancel closes without calling apiFetch). Use the action's
exported factory getResetNotificationEmailContentAction and mock/dispatch
editEntityRecord, saveEditedEntityRecord, createSuccessNotice,
createErrorNotice, and apiFetch to assert behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/reset-notification-email-content.tsx`:
- Around line 76-84: The code dereferences items[0] when building modalTitle
(using sprintf and getItemTitle) which will throw if items is empty; update the
reset-notification-email-content logic to guard against empty or falsy items
before accessing items[0]—for example, check items && items.length > 0 and
provide a safe fallback title (or bail out early) so modalTitle is only built
when getItemTitle receives a valid item; ensure the guard is applied where
modalTitle is computed and any subsequent uses of item are protected.

---

Nitpick comments:
In
`@plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/reset-notification-email-content.tsx`:
- Around line 38-183: Add unit/E2E tests for
getResetNotificationEmailContentAction covering the three paths: successful
reset, API error, and confirm-only fetch. Specifically, write tests that stub
apiFetch to return default content (assert parse/serialize flow, that
editEntityRecord and saveEditedEntityRecord are called with expected args and
createSuccessNotice is invoked with the snackbar id
'reset-notification-email-content-action'), stub apiFetch to throw (assert
createErrorNotice is called with the error message), and verify the confirm-only
UI path (modal opens, Cancel closes without calling apiFetch). Use the action's
exported factory getResetNotificationEmailContentAction and mock/dispatch
editEntityRecord, saveEditedEntityRecord, createSuccessNotice,
createErrorNotice, and apiFetch to assert behavior.

In `@plugins/woocommerce/src/Internal/EmailEditor/EmailApiController.php`:
- Around line 306-309: Replace the direct instantiation of
WCTransactionalEmailPostsGenerator with the DI/init() pattern used by the
codebase: obtain the generator via the controller's dependency initializer (e.g.
$this->init(WCTransactionalEmailPostsGenerator::class) or the equivalent
container accessor used elsewhere in EmailApiController) and use that instance
in place of new WCTransactionalEmailPostsGenerator(); update the method that
returns WP_REST_Response to call get_email_template on the injected instance so
the generator can be mocked and container-wired consistently.
- Around line 257-277: Add REST API tests for the new route registered by
register_routes (route: 'woocommerce-email-editor/v1' path
'/emails/(?P<id>\d+)/default-content', handler get_default_content_response'):
create a test class that extends WC_REST_Unit_Test_Case, ensure routes are
registered in setUp, then add three tests: (1) permission_denied: set current
user without manage_woocommerce capability, dispatch a GET WP_REST_Request to
the endpoint for an existing or arbitrary ID and assert a 403 response; (2)
unknown_post_id_returns_404: ensure no post exists for an ID (or use an
obviously invalid ID), dispatch GET and assert 404; (3)
successful_payload_shape: create a woo_email post (the post type used by the
controller), set a user with manage_woocommerce, dispatch GET for that post ID
and assert 200 and that the response data contains a 'content' field with the
expected structure/value; use rest_do_request / WP_REST_Request to call the
route and standard PHPUnit assertions for status and response data.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: c15ae8f1-a60b-4400-921f-6d2b305604c4

📥 Commits

Reviewing files that changed from the base of the PR and between 61bbf12 and cac6e5e.

📒 Files selected for processing (7)
  • packages/js/email-editor/changelog/wooprd-1019-export-register-entity-action
  • packages/js/email-editor/src/index.ts
  • plugins/woocommerce/changelog/wooprd-1019-add-reset-notification-email-content
  • plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/index.ts
  • plugins/woocommerce/client/admin/client/wp-admin-scripts/email-editor-integration/reset-notification-email-content.tsx
  • plugins/woocommerce/src/Internal/EmailEditor/EmailApiController.php
  • plugins/woocommerce/src/Internal/EmailEditor/Integration.php

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
plugins/woocommerce/src/Internal/EmailEditor/EmailApiController.php (1)

307-311: Consider injecting WCTransactionalEmailPostsGenerator via the DI container.

Directly instantiating WCTransactionalEmailPostsGenerator works but makes unit testing harder. You could inject it through the init() method like $this->post_manager for consistency with the DI pattern used elsewhere in this class.

♻️ Suggested refactor

Add a property and inject via init():

 private ?WCTransactionalEmailPostsManager $post_manager;
+private ?WCTransactionalEmailPostsGenerator $posts_generator;

 final public function init(): void {
     $this->post_manager = WCTransactionalEmailPostsManager::get_instance();
+    $this->posts_generator = new WCTransactionalEmailPostsGenerator();
 }

Then use the injected instance:

-$generator = new WCTransactionalEmailPostsGenerator();
-return new WP_REST_Response(
-    array( 'content' => $generator->get_email_template( $email ) ),
-    200
-);
+return new WP_REST_Response(
+    array( 'content' => $this->posts_generator->get_email_template( $email ) ),
+    200
+);

As per coding guidelines: "Dependencies in PHP classes should be injected via the DI container using the init() method pattern."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/woocommerce/src/Internal/EmailEditor/EmailApiController.php` around
lines 307 - 311, The code directly instantiates
WCTransactionalEmailPostsGenerator in EmailApiController; instead add a private
property (e.g. $email_posts_generator) to the class, accept and assign an
instance in the controller's init() method (matching how $this->post_manager is
injected), and replace new WCTransactionalEmailPostsGenerator() with the
injected $this->email_posts_generator->get_email_template($email) call so
get_email_template is used from the DI-provided instance for easier testing and
consistency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@plugins/woocommerce/src/Internal/EmailEditor/EmailApiController.php`:
- Around line 307-311: The code directly instantiates
WCTransactionalEmailPostsGenerator in EmailApiController; instead add a private
property (e.g. $email_posts_generator) to the class, accept and assign an
instance in the controller's init() method (matching how $this->post_manager is
injected), and replace new WCTransactionalEmailPostsGenerator() with the
injected $this->email_posts_generator->get_email_template($email) call so
get_email_template is used from the DI-provided instance for easier testing and
consistency.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 8019c067-1fd8-4fb0-8618-9376557be4c9

📥 Commits

Reviewing files that changed from the base of the PR and between cac6e5e and 4b4f452.

📒 Files selected for processing (1)
  • plugins/woocommerce/src/Internal/EmailEditor/EmailApiController.php

@triple0t triple0t requested review from lysyjan and removed request for a team March 5, 2026 21:33
@triple0t triple0t changed the title Wooprd 1019 add reset notification email content Add reset notification email content Mar 5, 2026
Copy link
Copy Markdown
Contributor

@lysyjan lysyjan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works well. There is only a tiny improvement that could be solved.

Image

Comment thread plugins/woocommerce/src/Internal/EmailEditor/EmailApiController.php
@lysyjan lysyjan assigned triple0t and unassigned lysyjan Mar 6, 2026
…nt schema

- Introduced WCTransactionalEmailPostsGenerator for managing email templates.
- Added get_default_content_schema method to define the schema for the default content endpoint response.
- Updated initialization logic to ensure both post manager and posts generator are set before generating email content.
@triple0t triple0t merged commit 1458129 into trunk Mar 9, 2026
59 checks passed
@triple0t triple0t deleted the wooprd-1019-add-reset-notification-email-content branch March 9, 2026 12:07
@github-actions github-actions Bot added this to the 10.7.0 milestone Mar 9, 2026
@github-actions github-actions Bot added the needs: documentation The issue/PR requires documentation to be added. label Mar 9, 2026
samnajian pushed a commit that referenced this pull request Mar 11, 2026
* Email Editor: Add reset notification email content action

  Registers a "Reset content to default" entity action for woo_email posts
  in the email editor. When triggered, it fetches the original plugin-
  distributed block template content via a new REST endpoint and restores
  the post content to that default state.

  - Add GET /woocommerce-email-editor/v1/emails/{id}/default-content endpoint
  - Export registerEntityAction and PostWithPermissions from email editor package
  - Register reset action for woo_email post type from email-editor-integration

* More route registration to the EmailApiController and remove support for WordPress 6.7 (Woo has discontinued it).

* Fix lint errors

* Fix lint error

* Enhance EmailApiController with new posts generator and default content schema

- Introduced WCTransactionalEmailPostsGenerator for managing email templates.
- Added get_default_content_schema method to define the schema for the default content endpoint response.
- Updated initialization logic to ensure both post manager and posts generator are set before generating email content.
jamesckemp pushed a commit that referenced this pull request Mar 11, 2026
* Email Editor: Add reset notification email content action

  Registers a "Reset content to default" entity action for woo_email posts
  in the email editor. When triggered, it fetches the original plugin-
  distributed block template content via a new REST endpoint and restores
  the post content to that default state.

  - Add GET /woocommerce-email-editor/v1/emails/{id}/default-content endpoint
  - Export registerEntityAction and PostWithPermissions from email editor package
  - Register reset action for woo_email post type from email-editor-integration

* More route registration to the EmailApiController and remove support for WordPress 6.7 (Woo has discontinued it).

* Fix lint errors

* Fix lint error

* Enhance EmailApiController with new posts generator and default content schema

- Introduced WCTransactionalEmailPostsGenerator for managing email templates.
- Added get_default_content_schema method to define the schema for the default content endpoint response.
- Updated initialization logic to ensure both post manager and posts generator are set before generating email content.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs: documentation The issue/PR requires documentation to be added. plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants