Skip to content

Debugging

Template JSON Debugger

Checks an exported Ecomail template file (.json) before you import it: broken JSON, the element tree, attributes, unsafe HTML, images, merge tags and fonts, with fix-ups and a downloadable fixed copy.

  • Runs in your browser
  • Free to run
Open the tool
You enter
A template .json (upload, drop or paste) or a bulk export .zip.
You get
A verdict, a problem list with JSON paths, a tree, the source with marked lines, a layout outline, images, merge tags, fonts and stats.
A good result
"Ready to import": no errors and no warnings.
On this page
  1. What it is for
  2. What you enter
  3. How it works
  4. Reading the results
  5. Example
  6. Limits and gotchas

#What it is for

Ecomail stores a drag-and-drop template as a JSON definition (mjml → mj-body → mj-section → mj-column → content) and imports such a file without checking it. A hand-edited, damaged or foreign file then fails later, in the editor or in the sent email. Run the file through this tool first, or use it when a client says an imported template looks wrong.

#What you enter

  • Drop or choose a .json file, or paste the JSON. Files up to 20 MB are read; Ecomail imports up to 4 MB.
  • A bulk export .zip: every .json inside is checked and listed (up to 300 files), and HTML saved under a .json name is flagged because it cannot be imported.
  • Three samples: a valid template, one with many problems, and broken JSON.

#How it works

Everything runs in your browser in a background worker, so a large file does not freeze the page. Nothing is uploaded. The checks, by area:

AreaWhat it finds
FileInvalid JSON with the line and column, HTML instead of JSON, a file over 4 MB, JSON encoded twice (a string that holds the JSON), a template wrapped in another object, a byte order mark.
StructureThe root must be mjml with one mj-body; sections hold columns, columns hold content. Column widths over 100 %, mixed units, empty sections and columns, duplicate keys.
ElementsUnknown tags (with a "did you mean"), elements the renderer drops or rewrites, images without src or alt text, buttons without a link or text.
AttributesUnknown attributes, editor-only attributes the renderer strips, and values: colours, sizes, padding, alignment, URLs and fonts.
HTML safety<script>, <iframe>, on… handlers and javascript: links in content, unclosed or stray tags. Ecomail does not sanitise on import, so they go into the email.
ImagesWhere each image is stored: Ecomail storage, the old S3 storage, external hosts, inline data, http:// and relative addresses.
Merge tagsMalformed or unknown *|TAG|*, wrong case, and a missing *|UNSUB|*.
Fonts and stylesFonts without a fallback, custom fonts, global attributes and style rules.

#Reading the results

The verdict is "Ready to import" (no errors or warnings), "Imports, but check the warnings" or "Will import, then break" (any error). Every problem has a level, a sentence, its JSON path (for example children[0].children[2].attributes.width) and buttons that jump to the line in the source or to the element in the tree.

Tree
The element tree with icons and problem badges. Pick an element to see its attributes, its problems and its HTML content; Preview content shows it in a sandbox with scripts blocked.
Source
The file as uploaded or formatted, with problem lines marked.
Outline
A rough map of sections, columns and blocks.
Images & tags
Every image with its host, a button that checks that the images load, merge tags and fonts.
Stats
Size, depth and a count of each element.

Fix-ups and download makes a fixed copy: decode a double-encoded file, remove dropped elements, remove editor-only attributes, remove unsafe HTML, rewrite an image address prefix, and save it pretty-printed or minified. The original file is never changed. Check the fixed copy opens the result in the tool. The report can be copied as Markdown or downloaded as JSON.

#Example

A double comma
"attributes": {
  "width": "600px",,
  "background-color": "#f4f4f4"
}

The tool says "Not valid JSON at line 22, column 26: expected a property name in double quotes, found ," and opens the source at that line with the spot marked.

#Limits and gotchas

  • The rules follow the Ecomail editor and renderer; a new element or attribute may show as unknown until the tool learns it.
  • The image check loads the images in your browser from your IP address. An image that needs a login, or a host that blocks hotlinking, can show as failed.
  • The history panel keeps only the file name and the counts. The file itself is kept in this browser (the last five, up to 1.5 MB each) so it can be reopened from there.
  • For an HTML template use the Email HTML Inspector; to convert images use the Image Converter.