Back to all posts
Tutorial
8 min read

How to Add a Drag-and-Drop Email Editor

DevToolLab Team

DevToolLab Team

December 3, 2026

How to Add a Drag-and-Drop Email Editor

A user sets up a campaign in your SaaS platform, then has to leave it to design the email. They export the message and upload it again. That break in the workflow is a reason to put an editor directly inside your app.

An embeddable email editor SDK gives your team the editing interface without requiring you to develop the entire design engine. Your application can keep ownership of accounts, permissions, campaign data, and sending. The embedded editor handles the visual composition and returns the email markup to your system.

This guide shows how we can decide between building and integrating, embed Stripo Plugin in four steps, write the small backend endpoint that keeps the Secret Key off the browser, and test the whole flow before release. The table below sums up the integration, and a diagram after step 4 shows how the pieces talk to each other.

The Integration at a Glance

StepWhere it runsWhat you end up with
1. Create a Plugin applicationStripo settingsA Plugin ID and a Secret Key
2. Add a containerYour page or modalA div the editor renders into
3. Load and initialize the editorBrowser, plus a token endpoint on your backendThe editor open on the saved draft
4. Save the draft and exportBrowser to your database and sending serviceEditable HTML/CSS and compiled HTML

What an Embedded Email Editor Needs to Do

A drag and drop email editor needs more than movable text boxes. Users expect reusable rows and columns, image and button blocks, responsive behavior, previews, undo and redo, and HTML that works in email clients.

A drag and drop email builder inside a SaaS product must also fit the existing workflow. It should open the right draft, respect account permissions, and return content your sending service can process. Your app still controls storage, approvals, and campaign delivery.

Email markup has constraints that ordinary web pages do not. Different clients support different CSS features, and some strip or reinterpret styles. A browser preview alone cannot confirm that a message will look the same in inboxes. Check the editor's export in the clients your users rely on, especially if your product serves teams with strict brand templates or transactional messages. Do this before promising a complete email workflow.

Build an Editor or Integrate One?

Building makes sense when email design is central to your product. You may need a proprietary canvas, a unique content model, unusual editing interactions, or control over every component. It may also be necessary when a vendor cannot meet your security, hosting, or data-residency requirements.

The work goes beyond drag-and-drop mechanics. Your team must maintain blocks, layout rules, responsive output, HTML/CSS export, image uploads, saving, previews, and email-client edge cases. Costs depend on scope and supported clients, so get an estimate from a feature list rather than relying on generic figures.

An email editor SDK is worth evaluating when email design supports the main product. Check whether it can:

  • Match your product's branding and navigation.
  • Add custom blocks or connect to your own content libraries.
  • Use your merge tags and personalization rules.
  • Store images where your security and ownership policies require.
  • Return editable HTML/CSS as well as compiled output.

A white label email builder can cover many branding needs through configurable styles and hidden vendor branding. It may not be enough if you want to replace the whole interface or change how the editor represents content. Prototype the most unusual part of your intended experience before committing.

Integrating Stripo Plugin

Stripo Plugin is a JavaScript email editor that can be embedded in a SaaS product, CRM, ESP, or website. It receives the email HTML and CSS, lets the user edit the design, and provides the updated content to your application. A practical integration can be split into four steps.

1. Create a Plugin Application

Sign in to Stripo and open Settings → Plugin → Create Application. Enter an application name and your company website, then copy the generated Plugin ID and Secret Key.

A Free plan is available for testing, with usage limits. Check the current plan details before rolling the feature out to customers. Keep the Secret Key on your server; never expose it in frontend JavaScript or a public repository.

2. Add a Container to Your App

Choose the page or modal where users will design emails and add an element with a unique ID:

<div id="stripoEditorContainer"></div>

Give the container enough height and test it at different viewport sizes. Check global CSS rules too; broad selectors can affect embedded components. Scope your styles or isolate the editor if needed.

3. Load and Initialize the Editor

Load the editor script on the page where the container exists:

HTML
<script
  id="UiEditorScript"
  type="module"
  src="https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js"
></script>

After the script loads, initialize the editor with the container and saved template:

JavaScript
const container = document.querySelector('#stripoEditorContainer');

window.UIEditor.initEditor(container, {
  html: savedHtml,
  css: savedCss,
  metadata: {
    emailId: currentEmailId
  },
  onTokenRefreshRequest(callback) {
    fetch('/api/stripo/token')
      .then(response => response.json())
      .then(({ token }) => callback(token));
  }
});

The token endpoint runs on your backend. It uses the Plugin ID and Secret Key to request a token from https://plugins.stripo.email/api/v1/auth, passing the current userId and the appropriate role. Return the token to the frontend callback. The Secret Key never reaches the browser, and the editor can request a fresh token when needed.

Here, savedHtml, savedCss, and currentEmailId are values loaded by your app. For a new email, pass the starter HTML and CSS. Give each draft a unique email ID so you can retrieve the right record later.

The Token Endpoint in Node.js

For example, say our app runs on Node.js and the signed-in user is user-1042. This endpoint uses only Node's built-in http module and fetch, reads the Plugin ID and Secret Key from environment variables, and sends the same four fields Stripo's own plugin samples send to the auth API:

JavaScript
import http from "node:http";

const AUTH_URL = process.env.STRIPO_AUTH_URL ?? "https://plugins.stripo.email/api/v1/auth";
const { STRIPO_PLUGIN_ID, STRIPO_SECRET_KEY } = process.env;

http.createServer(async (req, res) => {
  if (req.method !== "GET" || req.url !== "/api/stripo/token") {
    res.writeHead(404).end();
    return;
  }

  // In a real app, take the user ID from the signed-in session.
  const userId = "user-1042";

  const response = await fetch(AUTH_URL, {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      pluginId: STRIPO_PLUGIN_ID,
      secretKey: STRIPO_SECRET_KEY,
      userId,
      role: "user",
    }),
  });

  if (!response.ok) {
    res.writeHead(502, { "Content-Type": "application/json" });
    res.end(JSON.stringify({ error: `Stripo auth returned ${response.status}` }));
    return;
  }

  const { token } = await response.json();
  res.writeHead(200, { "Content-Type": "application/json" });
  res.end(JSON.stringify({ token }));
}).listen(3001, () => console.log("Token endpoint on http://localhost:3001/api/stripo/token"));

We ran it on Node 25 against a local stand-in for the auth API, so the token below is a placeholder rather than a real Stripo token. The stand-in logged the fields it received, and the browser side got back only the token:

text
Token endpoint on http://localhost:3001/api/stripo/token
auth request: pluginId, secretKey, userId, role | role: user | userId: user-1042
browser gets: 200 {"token":"eyJhbGciOiJIUzI1NiJ9.demo.sig"}

The response the browser sees has no secretKey in it, which is the whole point of the endpoint. Drop STRIPO_AUTH_URL in production so the request goes to Stripo's real auth API.

4. Save the Draft and Export the Email

Decide when to save: on a Save click, through autosave, or at another point in the workflow. To preserve an editable draft, retrieve its HTML and CSS and store them in your database. The current API provides getTemplateData; older examples may use getTemplate.

JavaScript
window.StripoEditorApi.actionsApi.getTemplateData(
  ({ html, css, width, height }) => {
    saveDraft({
      emailId: currentEmailId,
      html,
      css,
      width,
      height
    });
  }
);

When the user is ready to send the campaign, call compileEmail to get the compiled HTML:

JavaScript
window.StripoEditorApi.actionsApi.compileEmail({
  callback: (error, html, ampHtml, ampErrors) => {
    if (error) {
      showCompileError(error);
      return;
    }

    saveCompiledEmail({
      emailId: currentEmailId,
      html,
      ampHtml,
      ampErrors
    });
  },
  minimize: true
});

Keep editable source and compiled output separate. The source is for future changes; compiled HTML is for your sending service. Handle errors and test the result in the email clients your customers use.

How an embedded Stripo editor, your backend and Stripo exchange data: the browser asks your token endpoint for a token, the endpoint calls the Stripo auth API with the Plugin ID and Secret Key, the editor hands editable HTML and CSS and then compiled HTML back to your database, and your app sends the compiled HTML to your sending service
How an embedded Stripo editor, your backend and Stripo exchange data: the browser asks your token endpoint for a token, the endpoint calls the Stripo auth API with the Plugin ID and Secret Key, the editor hands editable HTML and CSS and then compiled HTML back to your database, and your app sends the compiled HTML to your sending service

The Secret Key only ever travels between your backend and Stripo. The browser holds a short-lived token, and your app keeps both copies of the email.

Features to Consider After the First Integration

Once the editor loads and saves correctly, configure it for your product.

Branding and white-label controls. Paid plans offer options to remove Stripo branding and adjust UI styles, colors, and fonts. Check the plan details before promising a fully branded experience.

Custom blocks and extensions. If customers repeatedly use the same product card or promotion layout, create a reusable block. Stripo's editor extensions let developers add custom blocks and controls; availability depends on the plan.

Merge tags and display conditions. Connect variables from your platform, such as a recipient's first name or subscription type. Your sending system replaces merge tags with customer data. Display conditions let content appear for selected audiences, while your app remains responsible for applying the relevant customer rules.

Image storage. Use Stripo's image storage or connect your own provider, such as AWS S3. Decide where assets should live before customers build large libraries; moving them later can affect image URLs in existing campaigns.

AI writing assistance. Optional tools include an AI email assistant for drafting or revising text and an AI subject line generator. Some features require API credentials, so check setup requirements before enabling them.

Plan changes. You can start with the Free plan and upgrade as usage grows. Stripo says an existing integration remains in place after a plan upgrade, so you do not need to reintegrate the editor. Check current limits and feature availability.

Test the Workflow Before Release

Test the full path from opening a draft to sending it. Create an email with a logo, two-column section, CTA, image, and merge tag. Save it, reopen it, and check that it remains editable. Compile it and inspect the HTML.

Also test token refresh, permissions, error handling, image access, and mobile behavior. In a multi-tenant app, confirm that one customer cannot access another customer's templates or assets.

Stripo has a public GitHub repository with Plugin samples. Use it to test the setup before adapting the code to your backend.

Conclusion

If email editing supports your product rather than defining it, an SDK can spare your team from maintaining a separate design tool. You still own authentication, permissions, storage, campaign logic, and sending.

If you need a proprietary editing model or hosting controls an external service cannot meet, build may be the better choice. For a configurable editor inside an existing app, Stripo.email is worth evaluating. Start with a small integration and test the exported email before expanding the feature.

  • HTML Formatter - pretty-print the compiled email HTML from compileEmail so you can inspect it before it goes to your sending service.
  • HTML to Text Converter - turn the compiled email into the plain-text part that many sending services expect alongside the HTML.
  • UTM Link Builder - tag the CTA links in a campaign so clicks from the email show up in your analytics.
  • Email Header Analyzer - read the headers of a test send to see how an inbox handled the message.

Related Posts

How to Create a Video Using AI for Free

We can create a video using AI for free with a script, a local AI voice and a code renderer, or let Gemini, Runway or HeyGen build it from a prompt.

By DevToolLab Team•

How to Decode Base64 in Terminal and Code

Decode Base64 with base64 -d, Python's b64decode or Node's Buffer, turn it back into a file, and fix Incorrect padding and atob errors.

By DevToolLab Team•

Git CVE-2026-111760: Check and Patch Git

CVE-2026-111760 lets a malicious repo run code during git clone --recurse-submodules. Check every Git, update to 2.56.1, and patch macOS, Ubuntu and CI.

By DevToolLab Team•