1001fx - NoCode functions icon

1001fx - NoCode functions

1001fx is a set of functions for any automation platform. Our functions are simple, very well tested, scalable and offer features that most automation platforms do not offer.

Actions74

data → Generate HTML Email Body with MJML

AI-generated

Overview

This node allows you to generate an HTML email body from an MJML template using the "Generate HTML Email Body with MJML" operation under the "data" resource. MJML is a markup language designed for responsive email design, and this node converts your MJML code into ready-to-send HTML. This is particularly useful for automating the creation of visually appealing, mobile-friendly emails in workflows such as marketing campaigns, notifications, or transactional messages.

Example scenarios:

  • Automating the generation of personalized newsletters.
  • Creating dynamic notification emails based on workflow data.
  • Converting designer-provided MJML templates into HTML for mass mailing.

Properties

Name Meaning
MJML MJML Template. The source MJML code to be converted to HTML. See MJML documentation for more information.
Validation Level Determines how strictly the MJML is validated before rendering:
- skip: No validation.
- soft: Validate but render even if errors exist.
- strict: Validate and do not render if any error is found. Defaults to skip.

Output

The output will be a JSON object containing the result of the MJML-to-HTML conversion. Typically, it includes:

{
  "html": "<!DOCTYPE html>...converted HTML content...",
  "errors": [] // Array of validation errors, if any (may be empty)
}
  • html: The generated HTML string ready for use in email clients.
  • errors: An array listing any issues found during validation (present if validation is enabled).

Note: This operation does not output binary data.

Dependencies

  • External Service: Requires access to the 1001fx API at https://api.1001fx.com.
  • API Key: You must configure the 1001fxApi credential in n8n.
  • Environment: No special environment variables are required beyond standard n8n setup.

Troubleshooting

Common Issues:

  • Invalid MJML Syntax: If your MJML template contains errors and you select "strict" validation, the node will not render the HTML and may return an error.
  • Authentication Errors: If the 1001fxApi credential is missing or invalid, requests will fail.
  • API Connectivity: Network issues or incorrect base URL configuration can prevent successful API calls.

Error Messages:

  • "error": "MJML syntax error": Indicates a problem with your MJML code. Review the template and correct any mistakes.
  • "error": "Unauthorized": Check your API credentials.
  • "error": "Network Error": Ensure that n8n can reach https://api.1001fx.com.

Links and References

Discussion