
Product
Introducing Reports: An Extensible Reporting Framework for Socket Data
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.
@maily-to/render
Advanced tools
Install @maily-to/render from your command line.
pnpm add @maily-to/render
Convert React components into a HTML string.
import { render } from '@maily-to/render';
const html = await render({
type: 'doc',
content: [
{
type: 'paragraph',
content: [
{
type: 'text',
text: 'Hello World!',
},
],
},
],
});
You can replace variables in the content.
import { Maily } from '@maily-to/render';
const maily = new Maily({
type: 'doc',
content: [
{
type: 'paragraph',
attrs: { textAlign: 'left' },
content: [
{
type: 'variable',
attrs: {
id: 'currentDate',
fallback: 'now',
showIfKey: null,
},
},
],
},
],
});
maily.setVariableValue('currentDate', new Date().toISOString());
const html = await maily.render();
Payload values are used for the Repeat and Show If blocks.
// (Omitted repeated imports)
const maily = new Maily({
type: 'doc',
content: [
{
type: 'repeat',
attrs: { each: 'items', showIfKey: null },
content: [
{
type: 'paragraph',
attrs: { textAlign: 'left' },
content: [{ type: 'text', text: 'Hello' }],
},
],
},
],
});
maily.setPayloadValue('items', ['Alice', 'Bob', 'Charlie']);
const html = await maily.render();
Feel free to submit pull requests, create issues, or spread the word.
MIT © Arik Chakma
FAQs
A transformer that converts Maily content into HTML email templates.
The npm package @maily-to/render receives a total of 6,514 weekly downloads. As such, @maily-to/render popularity was classified as popular.
We found that @maily-to/render demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.