You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

maily

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

maily

Use standard React to create the HTML emails of your imagination without a headache

npmnpm
Version
5.2.0
Version published
Weekly downloads
0
-100%
Maintainers
2
Weekly downloads
 
Created
Source

Maily

NPM version NPM license

In order to build great emails, every developer has the tendency of going crazy. To mitigate this, we've proposed Maily, a tool which can generate great emails using React, MJML and Express.

Maily runs as a service, to which you can POST data. It will return the appropriate HTML and text versions of your email respectively, based on the data you send to it.

As an example, you can run yarn example (with Node 8+), and request an HTML email or a text email

You'll easily build your emails using reusable components in React, and Maily will transform it to the 1993 HTML required by clients!

This allows you to write re-usable email components in a nice declarative language. An example!

<Envelope registeredUser={true} unsubscribeLink={this.props.unsubscribeLink>
<Greeting name={this.props.name} />
<Text>Thank you for registering. Your account has been activated. Click the button below to start!</Text>
<ActionButton href="https://your.inventid.nl">Visit personal page</ActionButton>
</Envelope>

Getting started

We have written two blogs posts on how you can create your emails using Maily, leveraging React in the process:

Or take a look at the /example directory!

Our usage

Internally, we use a Node.js project which houses our templates. Maily is added as the render server. Any service wishing to create an email, send the appropriate JSON in a HTTP POST to the correct template. The resulting HTML and text are added to the email, and then send.

This allows you to run maily as a simple stateless service in e.g. Docker. It also allows you to handle email as you wish, for example by adding attachments before sending.

Install

git clone https://github.com/inventid/maily
cd maily
npm install

Start server

npm start

Usage

Open a browser and go to: http://localhost:3000/{:template}?{key=value}&{...}

Data can be passed by using GET with query parameters or POST with a request body.

FAQs

Package last updated on 16 Sep 2019

Did you know?

Socket

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.

Install

Related posts