This guide walks you from creating a template in the Maildeno builder to rendering it in your application.
Prerequisites
-
A Maildeno account (free tier available)
-
Node.js ≥ 18 or Python ≥ 3.9 — pick whichever fits your stack
Step 1 — Create a template
-
Log in to the Maildeno Dashboard.
-
Navigate to Create Templates.
-
Drag or click layout block onto the canvas.
-
Drag a Heading block and a Text block onto the canvas.
-
In the heading block, type
Hello {{ name }}— this is a merge tag. -
Click Save.
-
Copy the Template ID from the template settings panel (it looks like
550e8400-e29b-41d4-a716-446655440000).
Step 2 — Create an API key
-
Go to Dashboard → API Keys → Create Key.
-
Give it a name (e.g.
quickstart-key) and leave Targets set toAll. -
Copy the generated key — you’ll only see it once.
| Never commit API keys to source control. Use environment variables or a secrets manager. |
Step 4 — Render your first email
Replace <YOUR_API_KEY> and <YOUR_TEMPLATE_ID> with your actual values.
-
JavaScript / TypeScript
-
Python (sync)
-
Python (async)
import { MaildenoClient } from "maildeno"
const client = new MaildenoClient({
apiKey: process.env.MAILDENO_API_KEY!,
})
const html = await client.renderHtml(
"<YOUR_TEMPLATE_ID>",
{
merge_tags: {
text: { name: "Noruwa" },
},
}
)
console.log(html) // <!DOCTYPE html>...
Load your API key from an environment variable — never hard-code it.
The `name` merge tag fills in the `{{ name }}` placeholder in your template.
import os
from maildeno import MaildenoClient
client = MaildenoClient(api_key=os.environ["MAILDENO_API_KEY"])
html = client.render_html(
"<YOUR_TEMPLATE_ID>",
{
"merge_tags": {
"text": {"name": "Noruwa"},
},
},
)
print(html) # <!DOCTYPE html>...
Load your API key from an environment variable.
Fills in the `{{ name }}` merge tag.
import asyncio
import os
from maildeno import AsyncMaildenoClient
async def main():
async with AsyncMaildenoClient(api_key=os.environ["MAILDENO_API_KEY"]) as client:
html = await client.render_html(
"<YOUR_TEMPLATE_ID>",
{"merge_tags": {"text": {"name": "Noruwa"}}},
)
print(html)
asyncio.run(main())
You should see a complete HTML document printed to stdout. 🎉