New:Socket for Asana Is Now Available.Learn more
Get Started

@templatical/import-unlayer

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@templatical/import-unlayer

Convert Unlayer email templates to Templatical format

Source
npmnpm
Version
0.27.1
Version published
Weekly downloads
742
-60.84%
Maintainers
1
Weekly downloads
 
Created
Source

@templatical/import-unlayer

Convert Unlayer email templates to Templatical's JSON format.

npm version License

Migrate from Unlayer (the react-email-editor design JSON) to Templatical without rebuilding your templates by hand. Maps Unlayer content types to Templatical block types and reports anything that needs manual review.

Install

npm install @templatical/import-unlayer

Usage

import { convertUnlayerTemplate } from '@templatical/import-unlayer';

// Whatever your Unlayer editor returned from `editor.saveDesign(...)`.
const unlayerJson = await fetch('/path/to/unlayer-design.json').then(r => r.json());

const result = convertUnlayerTemplate(unlayerJson);

console.log(result.content);   // → Templatical TemplateContent
console.log(result.report);    // → conversion report (per-content status, warnings, summary)

// Inspect content that didn't convert cleanly
for (const entry of result.report.entries) {
  if (entry.status !== 'converted') {
    console.warn(
      `${entry.unlayerContentType}${entry.templaticalBlockType ?? 'n/a'} ` +
      `(${entry.status})${entry.note ? `: ${entry.note}` : ''}`,
    );
  }
}

console.log(result.report.summary);
// { total, converted, approximated, htmlFallback, skipped }

What's converted

Unlayer contentTemplatical block
textParagraphBlock
headingTitleBlock
imageImageBlock
buttonButtonBlock
dividerDividerBlock
htmlHtmlBlock
menuMenuBlock
socialSocialIconsBlock
videoVideoBlock
timerHtmlBlock (fallback)
formskipped
Unknown contentFallback to HtmlBlock

Unknown or partially-supported content types are flagged in result.report so you can review them.

API

  • convertUnlayerTemplate(template) — converts an Unlayer design JSON, returns { content, report }

Types:

  • UnlayerTemplate — input shape (see source for full structure)
  • ImportResult{ content: TemplateContent, report: ImportReport }
  • ImportReport{ entries: ImportReportEntry[], warnings: string[], summary: { total, converted, approximated, htmlFallback, skipped } }
  • ImportReportEntry{ unlayerContentType, templaticalBlockType, status, note? }
  • ConversionStatus'converted' | 'approximated' | 'html-fallback' | 'skipped'

Documentation

Full reference at docs.templatical.com.

License

MIT

Keywords

email

FAQs

Package last updated on 20 Aug 2026

Related posts