cURL
curl --request POST \
--url https://api.helohq.com/templates/render \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "<string>",
"html": "<string>",
"mjml": "<string>",
"text": "<string>",
"inlineStyles": true,
"data": {}
}
'using HeloEmail.Sdk.Templates;
var renderTemplate = await helo.Templates.RenderDraft(new RenderDraftRequest
{
Subject = "test-subject",
Html = "test-html",
Mjml = "test-mjml",
Text = "test-text",
InlineStyles = true,
});Helo.configure do |config|
config.api_key = ENV.fetch("HELO_API_KEY")
end
render_draft_request = Helo::RenderDraftRequest.new(
subject: "test-subject",
html: "test-html",
mjml: "test-mjml",
text: "test-text",
inline_styles: true,
data: {}
)
Helo::Templates.render_draft(render_draft_request)import sdk_helo_email as helo
client = helo.Helo() # reads HELO_API_KEY from the environment
render_template = client.templates.render_draft(
subject="test-subject",
html="test-html",
mjml="test-mjml",
text="test-text",
inline_styles=True,
)package main
import (
"context"
"log"
"os"
"github.com/helo-email/helo-sdk-go"
)
func main() {
client := helo.NewHelo(os.Getenv("HELO_API_KEY"))
ctx := context.Background()
params := &helo.RenderDraftRequest{
Subject: "test-subject",
Html: "test-html",
Mjml: "test-mjml",
Text: "test-text",
InlineStyles: helo.Bool(true),
}
result, err := client.Templates.RenderDraft(ctx, params)
if err != nil {
log.Fatal(err)
}
_ = result
}import Helo from "@helo-email/sdk";
const apiKey = process.env.HELO_API_KEY;
const helo = new Helo(apiKey);
const result = await helo.templates.renderDraft({
subject: "test-subject",
html: "test-html",
mjml: "test-mjml",
text: "test-text",
inlineStyles: true,
data: {},
});{
"subject": "<string>",
"html": "<string>",
"text": "<string>"
}{
"type": "<string>",
"title": "<string>",
"instance": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"requestId": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"instance": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"requestId": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"instance": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"requestId": "<string>",
"errors": {}
}Templates
Render template content
Renders unsaved template content (subject, HTML or MJML, and text) with sample data, without persisting anything.
POST
/
templates
/
render
cURL
curl --request POST \
--url https://api.helohq.com/templates/render \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subject": "<string>",
"html": "<string>",
"mjml": "<string>",
"text": "<string>",
"inlineStyles": true,
"data": {}
}
'using HeloEmail.Sdk.Templates;
var renderTemplate = await helo.Templates.RenderDraft(new RenderDraftRequest
{
Subject = "test-subject",
Html = "test-html",
Mjml = "test-mjml",
Text = "test-text",
InlineStyles = true,
});Helo.configure do |config|
config.api_key = ENV.fetch("HELO_API_KEY")
end
render_draft_request = Helo::RenderDraftRequest.new(
subject: "test-subject",
html: "test-html",
mjml: "test-mjml",
text: "test-text",
inline_styles: true,
data: {}
)
Helo::Templates.render_draft(render_draft_request)import sdk_helo_email as helo
client = helo.Helo() # reads HELO_API_KEY from the environment
render_template = client.templates.render_draft(
subject="test-subject",
html="test-html",
mjml="test-mjml",
text="test-text",
inline_styles=True,
)package main
import (
"context"
"log"
"os"
"github.com/helo-email/helo-sdk-go"
)
func main() {
client := helo.NewHelo(os.Getenv("HELO_API_KEY"))
ctx := context.Background()
params := &helo.RenderDraftRequest{
Subject: "test-subject",
Html: "test-html",
Mjml: "test-mjml",
Text: "test-text",
InlineStyles: helo.Bool(true),
}
result, err := client.Templates.RenderDraft(ctx, params)
if err != nil {
log.Fatal(err)
}
_ = result
}import Helo from "@helo-email/sdk";
const apiKey = process.env.HELO_API_KEY;
const helo = new Helo(apiKey);
const result = await helo.templates.renderDraft({
subject: "test-subject",
html: "test-html",
mjml: "test-mjml",
text: "test-text",
inlineStyles: true,
data: {},
});{
"subject": "<string>",
"html": "<string>",
"text": "<string>"
}{
"type": "<string>",
"title": "<string>",
"instance": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"requestId": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"instance": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"requestId": "<string>",
"errors": {}
}{
"type": "<string>",
"title": "<string>",
"instance": "<string>",
"status": 123,
"code": "<string>",
"detail": "<string>",
"requestId": "<string>",
"errors": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Supplying both html and mjml in the same request is rejected.
Maximum 256 characters.
Maximum 500,000 characters.
Maximum 500,000 characters. The html it compiles to must also be within the html limit.
Maximum 100,000 characters.
Inline CSS into the HTML, as a send does. Defaults to true, so the preview matches what recipients receive.
Sample data used to interpolate Liquid variables.