All Projects → wix-incubator → Mjml React

wix-incubator / Mjml React

Licence: mit
React component library to generate the HTML emails on the fly

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Mjml React

Dotmailer Magento2 Extension
The official Engagement Cloud for Magento2 extension
Stars: ✭ 33 (-87.16%)
Mutual labels:  email-marketing, email
Awesome Emails
✉️ An awesome list of resources to build better emails.
Stars: ✭ 1,379 (+436.58%)
Mutual labels:  email-marketing, email
Mailerlite Api V2 Php Sdk
Official PHP wrapper for MailerLite HTTP API v2
Stars: ✭ 50 (-80.54%)
Mutual labels:  email-marketing, email
Email Extractor
The main functionality is to extract all the emails from one or several URLs - La funcionalidad principal es extraer todos los correos electrónicos de una o varias Url
Stars: ✭ 81 (-68.48%)
Mutual labels:  email-marketing, email
Email Dashboard
📪 An interactive emailing management service with scheduling, templating, tracking and A/B testing.
Stars: ✭ 194 (-24.51%)
Mutual labels:  email-marketing, email
Notifo
Multi channel notification service for collaboration tools, e-commerce, news service and more.
Stars: ✭ 32 (-87.55%)
Mutual labels:  email-marketing, email
Pine
A modular and lightweight, responsive email framework.
Stars: ✭ 98 (-61.87%)
Mutual labels:  email-marketing, email
Paperboy
💌💨 Email Campaign Delivery built with GoLang inspired by GoHugo
Stars: ✭ 411 (+59.92%)
Mutual labels:  email-marketing, email
Html Email Templates
Free HTML Email Templates created using the Postcards - https://designmodo.com/postcards/
Stars: ✭ 178 (-30.74%)
Mutual labels:  email-marketing, email
Responsive Html Email Template
A free simple responsive HTML email template
Stars: ✭ 10,831 (+4114.4%)
Mutual labels:  email-marketing, email
Mosaico
Mosaico - Responsive Email Template Editor
Stars: ✭ 1,392 (+441.63%)
Mutual labels:  email-marketing, email
bulk-email-sender
Send Templatized Dynamic Emails Automatically
Stars: ✭ 30 (-88.33%)
Mutual labels:  email, email-marketing
React Email Editor
Drag-n-Drop Email Editor Component for React.js
Stars: ✭ 3,131 (+1118.29%)
Mutual labels:  email-marketing, email
news-api
Go newsletter API backed by DynamoDB
Stars: ✭ 63 (-75.49%)
Mutual labels:  email, email-marketing
Copper
Copper mail : comprehensive email solution which can be readily deployed without complex configurations.
Stars: ✭ 12 (-95.33%)
Mutual labels:  email
traq
Super simple email open/click tracking server.
Stars: ✭ 62 (-75.88%)
Mutual labels:  email
laravel-mjml
Laravel MJML offers support for rendering MJML syntax into in-line HTML that can be sent within mails.
Stars: ✭ 26 (-89.88%)
Mutual labels:  email
fx-private-relay-add-on
Companion add-on for Firefox Relay. Keep your email safe from hackers and trackers. Make an email alias with one click, and keep your address to yourself.
Stars: ✭ 24 (-90.66%)
Mutual labels:  email
Php Imap Client
a easy solution for simple IMAP email access in php
Stars: ✭ 254 (-1.17%)
Mutual labels:  email
website-change-monitor
Monitor a website and get email and Slack notifications when specific changes are detected
Stars: ✭ 104 (-59.53%)
Mutual labels:  email

mjml-react · GitHub license npm version PRs Welcome

·

There is an awesome library mjml with github repo here https://github.com/mjmlio/mjml.

MJML is a markup language created by Mailjet. So in order to create emails on the fly we created a library with React components.

How it works

Install the required dependencies first:

npm install react react-dom mjml mjml-react

And afterwards write a code like a pro:

import {
  render,
  Mjml,
  MjmlHead,
  MjmlTitle,
  MjmlPreview,
  MjmlBody,
  MjmlSection,
  MjmlColumn,
  MjmlButton,
  MjmlImage
} from 'mjml-react';

const {html, errors} = render((
  <Mjml>
    <MjmlHead>
      <MjmlTitle>Last Minute Offer</MjmlTitle>
      <MjmlPreview>Last Minute Offer...</MjmlPreview>
    </MjmlHead>
    <MjmlBody width={500}>
      <MjmlSection fullWidth backgroundColor="#efefef">
        <MjmlColumn>
          <MjmlImage src="https://static.wixstatic.com/media/5cb24728abef45dabebe7edc1d97ddd2.jpg"/>
        </MjmlColumn>
      </MjmlSection>
      <MjmlSection>
        <MjmlColumn>
          <MjmlButton
            padding="20px"
            backgroundColor="#346DB7"
            href="https://www.wix.com/"
            >
            I like it!
          </MjmlButton>
        </MjmlColumn>
      </MjmlSection>
    </MjmlBody>
  </Mjml>
), {validationLevel: 'soft'});

And as the result you will get a nice looking email HTML (works in mobile too!)

preview

Options

mjml-react sets the following MJML options when rendering to HTML:

{
  keepComments: false,
  beautify: false,
  minify: true,
  validationLevel: 'strict'
}

If you want to override these, you can pass an object to render as a second argument. See the MJML docs for the full list of options you can set.

Extensions

import {
  MjmlHtml,
  MjmlComment,
  MjmlConditionalComment
} from 'mjml-react/extensions';

<MjmlComment>Built with ... at ...</MjmlComment>
// <!--Built with ... at ...-->

<MjmlConditionalComment>MSO conditionals</MjmlConditionalComment>
// <!--[if gte mso 9]>MSO conditionals<![endif]-->

<MjmlConditionalComment condition="if IE">MSO conditionals</MjmlConditionalComment>
// <!--[if IE]>MSO conditionals<![endif]-->

<MjmlHtml tag="div" html="<span>Hello World!</span>" />
// <div><span>Hello World!</span></div>

Utils

We do have also some utils for post processing the output HTML. Because not all mail clients do support named HTML entities, like &apos;. So we need to replace them to hex.

import {
  namedEntityToHexCode,
  fixConditionalComment
} from 'mjml-react/utils';

const html = '<div>&apos;</div>';
namedEntityToHexCode(html);
// <div>&#39;</div>

fixConditionalComment('<!--[if mso]><div>Hello World</div><![endif]-->', 'Hello', 'if IE');
// <!--[if IE]><div>Hello World</div><![endif]-->

Limitations

Currently mjml and mjml-react libraries are meant to be run inside a node.

Example project

You can find an example project here https://github.com/wix-incubator/mjml-react-example

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].