E-mail HTML builder
About this tool
How to use it
- Choose this tool.
- Add the blocks of your e-mail in order: headings, text, buttons and pictures.
- Set the title, the preview text, the width and the colours.
- Press Generate.
- Copy or download the finished e-mail.
What you get back
Try E-mail HTML builder in the Studio
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;