npm.io
0.13.0 • Published 11h ago

@templatical/import-html

Licence
MIT
Version
0.13.0
Deps
3
Size
93 kB
Vulns
0
Weekly
0
Stars
437

@templatical/import-html

Convert HTML email templates to Templatical format.

Designed for table-based marketing email HTML — output of MJML, Mailchimp/SendGrid/Campaign Monitor exports, hand-coded HTML emails. Modern (flex/grid) HTML is preserved via HTML-fallback blocks.

Install

npm install @templatical/import-html

Usage

import { convertHtmlTemplate } from '@templatical/import-html';

const html = await fetch('/path/to/email.html').then((r) => r.text());
const { content, report } = convertHtmlTemplate(html);

console.log(report.summary);
console.log(report.warnings);

See Migration from HTML for the full element-mapping table.

License

MIT

Keywords