Template

MJML + Better-Notify

Write responsive email templates in MJML markup and render them through Better-Notify. MJML compiles to bulletproof HTML that works across every email client.

Install

npm install @betternotify/mjml

Quick start

import { mjmlTemplate } from '@betternotify/mjml';

const catalog = rpc.catalog({
  receipt: rpc
    .email()
    .input(z.object({ amount: z.number(), orderId: z.string() }))
    .subject(({ input }) => `Receipt for order ${input.orderId}`)
    .template(mjmlTemplate(`<mjml>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-text>Receipt for order {{orderId}} — ${{amount}}</mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>`)),
});

Features

Read the docsGet started

Related integrations