-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Bug Report
Description
The email content editor does not work when an FSE (Full Site Editing / block) theme is active. When visiting the email customizer:
- The TinyMCE toolbar never loads — only a plain textarea is shown
- Typing in the textarea has no effect (changes are not saved/previewed)
- The live preview pane does not load correctly
Reported by a user on the WordPress.org support forum: https://wordpress.org/support/topic/no-email-customization-in-fse-theme/
Steps to Reproduce
- Activate any block/FSE theme (e.g. Twenty Twenty-Three, Twenty Twenty-Four)
- Go to Users → Emails
- Click Customize on any email
- The Customizer opens but the editor panel is broken — no TinyMCE toolbar, no live preview, changes don't save
Root Cause
The email editor is built entirely on top of the WordPress Customizer (customize.php). There are three layers of incompatibility with FSE themes:
-
Customizer preview iframe is broken with block themes. FSE themes do not support the Customizer preview mechanism. WordPress itself has been deprecating Customizer support for block themes since WP 5.9.
-
postMessagetransport silently fails. All three email settings (subject,title,content) usetransport: postMessage. This relies on a working Customizer preview iframe to relay changes in real time. With FSE, the iframe doesn't load so changes never propagate. -
TinyMCE doesn't initialize in the Customizer on FSE themes.
wp_enqueue_editor()is called incustomize_controls_enqueue_scriptsandwp.editor.initialize()is called on button click. With FSE themes, TinyMCE is not available in this context (WordPress has been progressively removing TinyMCE from block-theme admin contexts).
Affected Files
includes/emails/class-wpum-emails-customizer.php— registers all Customizer panels/settingsincludes/emails/class-wpum-emails-customizer-scripts.php— enqueues TinyMCE + JSincludes/emails/class-wpum-emails-customizer-editor-control.php— customWP_Customize_Controlfor the editorassets/js/src/admin/admin-email-customizer-controls.js— JS that callswp.editor.initialize()src/emails-list.vue— generates thecustomize.php?...URL for the Customize button
Options for Fix
Option A: Replace Customizer with a standalone admin page (recommended)
Replace customize.php with a dedicated admin subpage (admin.php?page=wpum-email-editor&email=<id>).
- Use
wp_editor()directly on the admin page — works with all themes, no Customizer dependency - Save via AJAX to the same
wpum_emailoption (backward compatible, no data migration) - Preview can be a non-live iframe (or a "Preview" button opening a new tab) showing the existing
email-customizer-previewtemplate - Change
getCustomizationURL()inemails-list.vueto point to the new page
Pros: Theme-agnostic, simpler, no Customizer dependency, wp_editor() is reliable in all admin contexts
Cons: Loses real-time live preview; more UI work needed
Backward compat: The wpum_email option format stays identical. Existing saved email content is preserved. The Customizer code can remain in place (deprecated) for any third-party integrations.
Option B: Keep the Customizer, fix TinyMCE + transport
Detect if a block theme is active (wp_is_block_theme(), available since WP 5.9) and conditionally:
- Force-enqueue TinyMCE in the Customizer context
- Switch content transport from
postMessagetorefresh
Pros: Minimal code change
Cons: The Customizer live preview is fundamentally broken with FSE themes regardless of TinyMCE — refresh transport reloads the iframe which still may not load. Treating symptoms rather than the root cause. Likely to break again with future WordPress versions as the Customizer continues to be deprecated for block themes.
Option C: Gutenberg-native editor panel
Build the email editor UI as a React component using @wordpress/components, embedded in a standalone admin page.
Pros: Fully modern, future-proof, consistent with block editor UX
Cons: Significant rewrite; likely out of scope for a bug fix
Notes
- Workaround for users: Switch to a classic theme (e.g. Twenty Twenty-One) to use the email editor
- Option A is the recommended path — it resolves the root cause cleanly and keeps backward compatibility
- Still need to assess: whether to keep the Customizer code as a fallback, or remove it entirely once the new page is in place