Export ZIP

Export

Export ZIP

A bundle: index.html + MJML + AMP + plain text + design JSON.

ts
ref.current.editor.exportZip((data) => data.zip); // Uint8Array
// server:  renderEmailZip(design)  // from email-craft-sdk

What is inside

  • index.html, the full HTML email, the same output as exportHtml.
  • email.mjml, the MJML source.
  • email.amp.html, the AMP document.
  • email.txt, the plain-text part.
  • design.json, the design, to open again with loadDesign.
  • README.txt, a short list of the files.

Files are stored without compression, so the archive is built the same way in the browser and in Node, and any zip tool opens it.

Download it in the browser

ts
ref.current.editor.exportZip((data) => {
  const blob = new Blob([data.zip], { type: "application/zip" });
  const link = document.createElement("a");
  link.href = URL.createObjectURL(blob);
  link.download = "email.zip";
  link.click();
  URL.revokeObjectURL(link.href);
});

Server options

renderEmailZip takes the usual render options plus includeAmp, includeMjml, includePlainText and includeJson, all true by default. emailZipFilename(design) turns the design title into a safe file name of up to 60 characters, or email.zip when the title is empty.