Keplars

Template Variables

Inject dynamic content into HTML templates using Handlebars double-brace syntax

Template Variables

HTML templates use the same Handlebars engine as MJML templates. Wrap any variable name in double curly braces and pass its value via params when sending.

Basic Syntax

<p>Hello {{firstName}},</p>
<p>Your order <strong>{{orderNumber}}</strong> has shipped.</p>

Variable names are case-sensitive. Use camelCase by convention.

System-Injected Variables

These variables are automatically available in every template: you do not need to pass them in params.

VariableDescription
{{viewInBrowserUrl}}Hosted version of the email, auto-generated per send
{{unsubscribeUrl}}One-click unsubscribe link, required for bulk sends

ZIP Import Normalization

If your design tool exports templates with spaced braces (common in Figma/Canva exports), Keplars normalizes them on import:

{{ firstName }}  →  {{firstName}}

This happens automatically: no manual find-and-replace needed.

Sending with Variables via API

curl -X POST "https://api.keplars.com/api/v1/send-email/instant" \
  -H "Authorization: Bearer $KEPLARS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":["[email protected]"],"template_id":"your-template-id","params":{"firstName":"Jane","orderNumber":"ORD-9912","shipDate":"2026-06-20"}}'
const res = await fetch(
  'https://api.keplars.com/api/v1/send-email/instant',
  {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.KEPLARS_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
    to: ['[email protected]'],
    template_id: 'your-template-id',
    params: { firstName: 'Jane', orderNumber: 'ORD-9912', shipDate: '2026-06-20' },
  }),
  },
);
const { data } = await res.json();
import requests, os
res = requests.post(
    'https://api.keplars.com/api/v1/send-email/instant',
    json={
        'to': ['[email protected]'],
        'template_id': 'your-template-id',
        'params': {'firstName': 'Jane', 'orderNumber': 'ORD-9912', 'shipDate': '2026-06-20'},
    },
    headers={'Authorization': f'Bearer {os.environ["KEPLARS_API_KEY"]}'},
)
data = res.json()['data']
package main

import (
    "bytes"
    "fmt"
    "io"
    "net/http"
    "os"
)

func main() {
    body := bytes.NewBufferString(`{"to":["[email protected]"],"template_id":"your-template-id","params":{"firstName":"Jane","orderNumber":"ORD-9912","shipDate":"2026-06-20"}}`)
    req, _ := http.NewRequest("POST",
        "https://api.keplars.com/api/v1/send-email/instant", body)
    req.Header.Set("Authorization", "Bearer "+os.Getenv("KEPLARS_API_KEY"))
    req.Header.Set("Content-Type", "application/json")
    resp, _ := (&http.Client{}).Do(req)
    defer resp.Body.Close()
    b, _ := io.ReadAll(resp.Body)
    fmt.Println(string(b))
}
<?php
$ch = curl_init('https://api.keplars.com/api/v1/send-email/instant');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_POSTFIELDS     => json_encode([
        'to' => ['[email protected]'],
        'template_id' => 'your-template-id',
        'params' => ['firstName' => 'Jane', 'orderNumber' => 'ORD-9912', 'shipDate' => '2026-06-20'],
    ]),
    CURLOPT_HTTPHEADER     => [
        'Authorization: Bearer ' . getenv('KEPLARS_API_KEY'),
        'Content-Type: application/json',
    ],
]);
$data = json_decode(curl_exec($ch), true)['data'];
curl_close($ch);
using System.Net.Http;
using System.Net.Http.Json;

var client = new HttpClient();
client.DefaultRequestHeaders.Add(
    "Authorization", $"Bearer {Environment.GetEnvironmentVariable("KEPLARS_API_KEY")}"
);
var response = await client.PostAsJsonAsync(
    "https://api.keplars.com/api/v1/send-email/instant",
    new
{
    to = new[] { "[email protected]" },
    template_id = "your-template-id",
    params = new { firstName = "Jane", orderNumber = "ORD-9912", shipDate = "2026-06-20" }
}
);
var body = await response.Content.ReadAsStringAsync();
use reqwest::Client;
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    let res = client
        .post("https://api.keplars.com/api/v1/send-email/instant")
        .header("Authorization", format!("Bearer {}", std::env::var("KEPLARS_API_KEY")?))
        .json(&json!({
    "to": [
        "[email protected]"
    ],
    "template_id": "your-template-id",
    "params": {
        "firstName": "Jane",
        "orderNumber": "ORD-9912",
        "shipDate": "2026-06-20"
    }
}))
        .send()
        .await?;
    let data: serde_json::Value = res.json().await?;
    println!("{}", data);
    Ok(())
}
#include <curl/curl.h>
#include <cstdlib>
#include <string>

int main() {
    CURL* curl = curl_easy_init();
    std::string auth = std::string("Authorization: Bearer ") + std::getenv("KEPLARS_API_KEY");
    const char* payload = "{\"to\":[\"[email protected]\"],\"template_id\":\"your-template-id\",\"params\":{\"firstName\":\"Jane\",\"orderNumber\":\"ORD-9912\",\"shipDate\":\"2026-06-20\"}}";
    struct curl_slist* headers = nullptr;
    headers = curl_slist_append(headers, auth.c_str());
    headers = curl_slist_append(headers, "Content-Type: application/json");
    curl_easy_setopt(curl, CURLOPT_URL, "https://api.keplars.com/api/v1/send-email/instant");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);
    curl_easy_perform(curl);
    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
}
#include <curl/curl.h>
#include <stdio.h>
#include <stdlib.h>

int main(void) {
    CURL* curl = curl_easy_init();
    char auth[256];
    snprintf(auth, sizeof(auth), "Authorization: Bearer %s", getenv("KEPLARS_API_KEY"));
    const char* payload = "{\"to\":[\"[email protected]\"],\"template_id\":\"your-template-id\",\"params\":{\"firstName\":\"Jane\",\"orderNumber\":\"ORD-9912\",\"shipDate\":\"2026-06-20\"}}";
    struct curl_slist* headers = NULL;
    headers = curl_slist_append(headers, auth);
    headers = curl_slist_append(headers, "Content-Type: application/json");
    curl_easy_setopt(curl, CURLOPT_URL, "https://api.keplars.com/api/v1/send-email/instant");
    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);
    curl_easy_perform(curl);
    curl_slist_free_all(headers);
    curl_easy_cleanup(curl);
    return 0;
}

For the full list of Handlebars helpers (conditionals, date formatting, currency) see Email Templates.

On this page