Email Editor
  • Get Started
    • Installation and Usage
    • Run Locally
  • Components
    • Button
    • Container
    • Divider
    • HTML Box
    • Image
    • Text
    • Video
  • Customization
  • Benefits
Powered by GitBook
On this page

Customization

This page will give a brief overview on how to create your own user component.

PreviousVideoNextBenefits

Last updated 3 years ago

Create the component's folder

The user components of email editor is present inside email-editor/app/src/core/design/components/userComponents . The first step is to create your own component's folder inside it.

Adding YourComponent.js and YourComponentSettings.js

The folder consists of two main files. The first file contains the component that will be displayed in your editor and the second one contains default settings and component's settings that will let you change the size, color, background, margin, padding etc.

Add the component's settings

In YourComponentSettings.js add all the properties you want to have. You can take help from our custom accordions present in SettingsUtils.js. It contains built in accordions for different properties like size, alignment, margin, padding, etc. Import the default settings and component's settings to YourComponent.js where you can apply the default settings to your component.

Import your component

Import the component to ToolBox.js[email-editor/app/src/core/design/utils/ToolBox.js]. Add an icon of your choice so it creates a new node with your component on click.

Import it to EmailEditor.js to finally render the component on load.

Include it in the server

In order to view your component in preview dialog, you have to include it in the server. Create YourComponent folder inside email-editor/server/main/exportComponents. Create YourComponentExport.js, import it in index.js and craftNodesProcessor.js. Restart your server and run the app. You can now use your own component!!

Icons for user components