Overview
This node converts MJML markup into HTML. MJML is a markup language designed to simplify the creation of responsive email templates. The node takes MJML code as input and outputs the corresponding HTML code, which can then be used in email campaigns or other HTML-based content.
Common scenarios where this node is beneficial include:
- Automating the conversion of MJML email templates into HTML within an n8n workflow.
- Dynamically generating responsive HTML emails from MJML snippets stored or generated during workflow execution.
- Integrating MJML-to-HTML conversion as part of a larger email sending or templating process.
For example, you might use this node to convert a custom MJML template into HTML before passing it to an email sending service node.
Properties
Name | Meaning |
---|---|
Property Name | The name of the property where the resulting HTML will be written. Supports dot-notation for nested properties. Example: data.person[0].name |
MJML | The MJML markup string to convert into HTML. This field supports multiline editing. |
Output
The node outputs an array of items, each containing:
- A
json
object that includes all original input JSON data plus a new property (as specified by the "Property Name" input) containing the converted HTML string. - If the input item contains binary data, it is preserved and passed through unchanged.
No binary output is generated by this node; it only modifies or adds JSON properties with the HTML result.
Dependencies
- Requires the
mjml
library to perform the MJML to HTML conversion. - No external API keys or credentials are needed.
- No special environment variables or n8n configurations are required.
Troubleshooting
- Invalid MJML markup: If the MJML input is malformed or invalid, the node will throw an error during conversion. To handle this gracefully, enable "Continue On Fail" in the node settings to skip problematic items without stopping the entire workflow.
- Incorrect property path: If the "Property Name" uses incorrect dot-notation or points to a non-writable location, the node may fail to set the HTML output properly.
- Empty MJML input: Providing an empty MJML string will result in minimal or empty HTML output, which might not be useful downstream.