Skip to main content
Templates let you define email HTML once, store it in Hiveku, and render it with dynamic variables at send time. They are the right tool for any email you send more than a handful of times — welcome emails, password resets, order confirmations, subscription renewals.

Why templates

  • Reuse — One source of truth; update HTML in one place
  • Consistency — Every send uses the same layout, tokens, and defaults
  • Versioning — Every edit creates a new version; roll back if something breaks
  • Separation of concerns — Designers own the HTML, engineers just pass variables
  • Analytics — Track open and click rates per template

Create a template

1

Open Templates

Go to Settings > Email > Templates > New.
2

Write the HTML

Use the built-in editor or paste in HTML from your design tool (MJML, Maizzle, Unlayer, etc.). The editor renders a live preview.
3

Declare variables

Add each variable the template uses, with a name, type, and whether it is required. See Variables below.
4

Set defaults

Optionally set a default from address and reply_to for this template.
5

Save

Saving creates version 1. Subsequent edits create new versions.

Variables

Variables use {{double-brace}} syntax and support dot notation for nested values:
<h1>Hi {{customer_name}},</h1>
<p>Your order #{{order.number}} for ${{order.total}} has shipped.</p>
<p>Track it here: {{tracking_url}}</p>
Declare each variable with a type hint:
TypeExampleNotes
string"Alice"Default; supports HTML-escaped rendering
number42Formatted per locale
booleantrueUseful for conditionals
date"2026-04-17"Formatted to the recipient’s locale
Hiveku validates the variables payload on every send — passing a missing required variable fails with 422 Unprocessable Entity before the email is ever queued.

Template-specific defaults

Set these per template so callers do not have to pass them every time:
  • Default from — e.g., "Acme Orders <orders@mail.acme.com>"
  • Default reply_to — e.g., "support@acme.com"
  • Default subject — Can still be overridden at send time

Version control

Every save creates a new version. You can:
  • View a diff between any two versions
  • Preview any version with sample variables
  • Roll back to a previous version with one click
  • Send from a specific version (pin legacy flows to an older version if needed)
When making breaking changes (renaming variables, removing fields), create a new template instead of a new version. This gives you a clean cutover without surprising in-flight callers.

Send with a template

import { Hiveku } from "@hiveku-apps/email";

const hiveku = new Hiveku({ apiKey: process.env.HIVEKU_API_KEY! });

await hiveku.emails.sendTemplate({
  template_id: "tmpl_order_shipped",
  to: "customer@example.com",
  variables: {
    customer_name: "Sam",
    order: {
      number: "1024",
      total: 49.99,
    },
    tracking_url: "https://acme.com/track/ABC123",
  },
});
You can still override any top-level email parameter (subject, from, tags, etc.) at send time — the template’s defaults fill in anything you omit. See Sending Emails for the full parameter list.

Tracking template usage

Each template has a stats view showing:
  • Total sends (today, 7 days, 30 days)
  • Delivery rate
  • Open and click rates
  • Bounce and complaint counts
  • Version breakdown (which version delivered which sends)
Use this to A/B test subject lines, spot regressions after a template edit, and identify high-complaint templates that need copy review.