View Source ExMjml (ex_mjml v1.3.0)

Module to convert/render MFML templates to HTML.

Link to this section Summary

Functions

Converts an MJML string to HTML content.

Link to this section Functions

Converts an MJML string to HTML content.

Returns a result tuple:

  • {:ok, html} for a successful MJML transpiling
  • {:error, message} for a failed MJML transpiling

examples

Examples

iex> ExMjml.to_html("<mjml><mj-head></mj-head></mjml>")
{:ok, "<!doctype html><html xmlns=..."}

iex> ExMjml.to_html("something not MJML")
{:error, "Couldn't convert MJML template"}