Quick start
If you use the standaloneEmailEditor component, you can access the email HTML and plain text through a template ref.
All three use composeVueEmail under the hood. The
@update
and @ready events receive the same object.
Using without EmailEditor
Use composeVueEmail directly to convert editor content into email-ready HTML and plain text without EmailEditor.export-panel.vue
my-editor.vue
How it works
ThecomposeVueEmail function follows this pipeline:
- Read the editor’s JSON document
- Traverse each node and mark in the document tree
- Call
renderToVueEmail()on eachEmailNodeandEmailMarkextension - Apply theme styles via the
SerializerPlugin(ifEmailThemingis configured) - Wrap the content in a
BaseTemplate - Renders to an HTML string and plain text version using render
Preview text
Thepreview parameter sets the email preview text.
Email preview text is the snippet shown in inbox list views before the email is opened.
preview out to omit preview text.
Using with theming
When theEmailTheming extension is in your extensions array, theme styles are automatically
injected into the exported HTML.
The serializer uses the SerializerPlugin provided by EmailTheming to resolve styles for each node based on the current theme and depth in the
document tree.
Full example with export panel
Here’s a complete editor with theming and an export panel, using theexport-panel.vue component from above.
full-email-builder.vue
Examples
See email export in action with runnable examples:Email Export
Export editor content to themed HTML.
Full Email Builder
Complete editor with theming, menus, and export.