MJML email HTML templates for Constructive
Generates responsive email HTML from a single generate() call with configurable header, message + CTA button, and footer. Peer dependencies: react (>=16), react-dom (>=16).
npm install @constructive-io/mjmlimport { generate } from '@constructive-io/mjml';
const html = generate({
title: 'Confirm your email',
message: 'Click the button below to confirm.',
link: 'https://example.com/confirm?token=abc',
linkText: 'Confirm',
companyName: 'Acme, Inc.',
supportEmail: 'support@acme.com',
website: 'https://acme.com',
logo: 'https://acme.com/logo.png'
});
// Send html with @constructive-io/postmaster or any email senderReturns email HTML. All options are optional; defaults provide a generic template.
Options: title, link, linkText, message, subMessage, bodyBgColor, messageBgColor, messageTextColor, messageButtonBgColor, messageButtonTextColor, companyName, supportEmail, website, logo, headerBgColor, headerImageProps.
Header,Footer,ButtonWithMessage— exported for custom compositions withmjml-react.- Types:
GenerateOptions,HeaderProps,FooterProps,ButtonWithMessageProps,HeaderImageProps.