
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
mailui-editor-react
Advanced tools
Enhance your app with MailUi user-friendly React.js wrapper component for designing emails. Enjoy it's easy drag-and-drop editor, making email creation a breeze!
A minimal demo page can be found in example
directory.
Install it from npm and include it in your React build process
npm install react-mailui-editor --save
OR
yarn add react-mailui-editor
Require the MailUiEditor component and render it with JSX:
import React, {useRef} from 'react';
import MailUiEditor, {MailUiEditorRef, MailUiEditorProps} from 'react-mailui-editor';
const ExampleComponent = () => {
const ref = useRef < MailUiEditorRef > (null);
const exportHtml = () => {
const mailui = ref.current?.editor;
mailui?.exportHtml((data) => {
const {design, html} = data;
console.log('exportHtml', html);
});
};
const onReady: MailUiEditorProps['onReady'] = (mailui) => {
// Editor is ready
// You can load your template here;
// The design JSON can be obtained by calling mailui.loadDesign(callback) or mailui.exportHtml(callback)
// For example:
// const templateJson = { DESIGN JSON GOES HERE };
// mailui.loadDesign(templateJson);
};
return (
<div>
<div>
<button onClick={exportHtml}>Export HTML</button>
</div>
<EmailEditor ref={emailEditorRef} onReady={onReady}/>
</div>
);
};
export default ExampleComponent;
See the example source for a reference implementation.
All MailUi methods are available in the editor instance (emailEditorRef.current.editor
). See
the MailUi Docs for more information, or log the object in the console to explore it. Here
are the most used ones:
method | params | description |
---|---|---|
loadDesign | Object data | Takes the design JSON and loads it in the editor |
saveDesign | Function callback | Returns the design JSON in a callback function |
exportHtml | Function callback | Returns the design HTML and JSON in a callback function |
editorId
{String
} HTML div id of the container where the editor will be embedded (optional)minHeight
{String
} minimum height to initialize the editor with (default 500px)onLoad
{Function
} called when the editor instance is createdonReady
{Function
} called when the editor has finished loadingoptions
{Object
} options passed to the MailUi editor instance (default {})
style
{Object
} style object for the editor container (default {})MailUi supports all modern browsers. It is tested with the latest versions of Chrome, Edge, Safari, Firefox, and Opera.
The following browsers are supported out of the box in MailUi v0.0.1.beta:
Please be aware that the MailUi editor is currently not compatible with Internet Explorer
, and there are no plans to
add support for it in the future.
To use the latest version of MailUi editor, your project needs to use React 15.5 or later.
If you use an older version of React, please refer to the table below to a find suitable MailUi version.
React version | Newest compatible MailUi version |
---|---|
≥15.5 | latest |
You can submit new language translations by creating a PR on this GitHub repo: https://github.com/MailUi/mailui-editor-translations. Translations managed by PhraseApp
Copyright (c) 2023 MailUi. MIT Licensed.
FAQs
Email template drag and drop builder.
The npm package mailui-editor-react receives a total of 36 weekly downloads. As such, mailui-editor-react popularity was classified as not popular.
We found that mailui-editor-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.