Skip to content

Feat: A major changes includes: Builder UI for emails, slack - #10

Merged
kriss145 merged 41 commits into
developfrom
feat/builder-ui
Feb 5, 2026
Merged

Feat: A major changes includes: Builder UI for emails, slack#10
kriss145 merged 41 commits into
developfrom
feat/builder-ui

Conversation

@kriss145

@kriss145 kriss145 commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

MPN Builder UI

This PR introduces a complete rebuild of the notification templates system with a new MPN Builder module, full UI builder, Slack Block Kit support, and comprehensive template management capabilities.

Breaking Changes

API Routes Changed

All API endpoints moved from /api/admin/notification-plugin/ to /api/admin/mpn/. Update all API integrations.

Admin UI Routes Changed

Admin UI routes changed from /notifications-emails/ to /mpn/notifications/. Update all Admin UI links/bookmarks.

Module Restructure

Modules moved from templates/ to modules/mpn-builder/. Update all direct imports from templates/.

Old Workflows Removed

Removed old workflows (email-service, mpn-templates/*). Migrate to new mpn-builder/* workflows.

Email and Slack Service Import Changed

Changed import and execution method:

Before:

import { emailService } from "../templates/emails"
await emailService.render(...)

After:

import { emailServiceWorkflow } from "../workflows/mpn-builder-services/email-service"
await emailServiceWorkflow(container).run({...})

Template ID Handling Changed

Template ID handling changed - system_ prefix removed from UI display (still used internally), unified to kebab-case format.


New Features

MPN Builder Module

Complete mpn-builder module with template management (services, models, 3 migrations).

UI Builder for Templates

Full-featured UI builder with drag & drop, inline editing, template preview, and support for multiple block types (heading, text, row, separator, group, repeater, product-item).

Slack Block Kit Support

Complete Slack Block Kit format support with block transformation, data interpolation, and nested structures.

External Templates Support

Support for external templates with type filtering (system, db, external). Configure via medusa-config.ts:

{
  resolve: "@codee-sh/medusa-plugin-notification-emails",
  options: {
    extend: {
      services: [{
        id: "slack",
        templates: [{
          name: "external_template-name",
          path: path.resolve(require.resolve("@package/templates/slack/template"))
        }]
      }]
    }
  }
}

New Block Types

Support for group, repeater, and product-item blocks with recursive rendering and data interpolation.

New Workflows and Steps

Added 10+ workflows for template management (create, edit, delete, get templates/blocks/services/types) with full JSDoc documentation.

Helper Components

Added helper components (ManagerFields, TwoColumnPage, form fields).

Store and Region Workflows

Added workflows for retrieving Store and Region data for template preview context.

API Middleware

Added middleware for API routing (error handling, request validation).


Improvements

  • Code refactoring (standardized naming, renamed methods, removed unused code)
  • Template ID handling fixes (unified format, kebab-case)
  • Fixed block data structure (added parent_id support, arrayPath for repeaters)
  • Added JSDoc documentation for all workflows and steps
  • UI improvements (button sizes, field descriptions, two-column layout)
  • Improved data handling (added region to queries, improved filtering)
  • Added new UI dependencies (@dnd-kit/core, @lexical/*, @react-email/*, react-email)

Testing Checklist

  • Test API endpoints migration (/api/admin/mpn/*)
  • Test Admin UI routes (/mpn/notifications/*, /mpn/templates/*)
  • Test template creation/editing/deletion via UI
  • Test block drag & drop functionality
  • Test Slack Block Kit rendering
  • Test external templates configuration
  • Test email/Slack service workflow migration
  • Test template ID handling (system/db/external)

Documentation

  • Changeset created (.changeset/major-release-builder-ui.md)
  • JSDoc added to all workflows and steps

- refactor routes with a new urls
feat: add blocks page with edit, add, delete blocks
- improve block edit workflow step
- improve models
…ser templates

from database. For user templates, blocks are fetched via `getBlocksByTemplateWorkflow`
and transformed before rendering, while system templates use empty blocks and template
name without prefix.
…Removed deprecated email-service workflow and adjusted template ID handling in order-related email handlers.
…cated `mpn-templates` workflows and updating related imports. Adjusted template ID handling in rendering logic.
…ting imports. Cleaned up deprecated template definitions in favor of a more streamlined approach.
…cross various schemas and workflows for consistent formatting.
… various fields in the general form. Adjust button sizes for better UI consistency in the templates list.
…ID usage and comment out translation options for clarity.
…sed files; update contact form, inventory level, order completed, and order placed previews to use local email template service.
…sed on data availability; streamline template rendering in the main list for improved clarity and organization.
…plateServices for clarity; update related workflows and subscribers to use consistent template_id naming convention; remove unused get-template-by-id workflow and steps.
…ctor email service workflow to enhance clarity and streamline imports; update template list components for improved data handling and organization.
Enhance clarity by adding detailed JSDoc comments to the create, edit, delete, and retrieval workflows and steps for notification templates. Each comment includes usage examples to guide developers in implementing these functionalities effectively.
…k template service and types, update Slack template configurations to utilize backendUrl for dynamic URL generation, and enhance template rendering workflows with service_id filtering for improved functionality.
…files to clean up code and improve readability.
Enhance MpnBuilderService by implementing the initialization of extended services, allowing for custom handlers and templates to be registered asynchronously.
…eamline project structure and improve maintainability.
Enhance the getTemplatesByTypeServiceStep to include support for retrieving system templates when the type_id is "external". This addition allows for more flexible template management based on service_id.
… external templates, improving the flexibility of template management.
@kriss145
kriss145 merged commit 300da3e into develop Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant