Free plan

E-mail HTML builder

Design an e-mail with headings, buttons and pictures
POST
/v1/documents/email-html

About this tool

This tool builds the web page code for a newsletter or e-mail from simple blocks, such as heading, text, button, picture, list and footer. It is made to look right in most mail programs, including Outlook, and in dark mode. You choose the width, colours and font. It does not send the e-mail; you paste the result into your mailing tool.
For example, you build a monthly newsletter with a logo, a few paragraphs and a button that links to your shop.

How to use it

  1. Choose this tool.
  2. Add the blocks of your e-mail in order: headings, text, buttons and pictures.
  3. Set the title, the preview text, the width and the colours.
  4. Press Generate.
  5. Copy or download the finished e-mail.

What you get back

You get the finished e-mail as HTML (web page code) to copy or download, plus a plain-text version. Paste it into your mailing tool.
GOOD TO KNOW
Text is escaped, links must be http(s), mailto or tel, and html blocks may not contain scripts or event handlers. Send both the html and the text. No file is needed. Counts as one document.
TEST IT LIVE

Try E-mail HTML builder in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Documents
Plan
Free
Method
POST
Endpoint
/v1/documents/email-html
Tool ID
documents.email-html
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Documents
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/documents/email-html" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'blocks=[{"type":"heading","text":"Welcome"},{"type":"button","text":"Open","url":"https://example.com"}]' \
  -F 'title=Welcome to Acme' \
  -F 'preheader=Your account is ready.'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.documents.emailHtml({
    "blocks": "[{\"type\":\"heading\",\"text\":\"Welcome\"},{\"type\":\"button\",\"text\":\"Open\",\"url\":\"https://example.com\"}]",
    "title": "Welcome to Acme",
    "preheader": "Your account is ready."
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->documents()->emailHtml([
    'blocks' => '[{"type":"heading","text":"Welcome"},{"type":"button","text":"Open","url":"https://example.com"}]',
    'title' => 'Welcome to Acme',
    'preheader' => 'Your account is ready.',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Build an e-mail from blocks (heading, text, button, image, divider, spacer, list, quote, columns, social, footer): table layout, inline styles, an Outlook-safe button, a preheader, dark mode, right-to-left support, a plain-text version and delivery checks.

E-mail HTML builder works from text and settings, so no file is needed. The required inputs are blocks.

E-mail HTML builder is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/documents/email-html with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.