Email templates in MigoSMTP are reusable HTML email designs that you can store, version, and call by ID when sending through the API — eliminating the need to include the full HTML in every send request. This article walks you through creating, saving, and using your first email template.
Why Use Templates?
| Benefit | Details |
|---|---|
| Consistency | Every email sent using the template has the same header, footer, branding, and legal text — you do not need to replicate these in every send request. |
| Smaller API payloads | Instead of sending full HTML in every API call, you pass a template ID and recipient-specific variables. A transactional order confirmation might only require the order number and amount. |
| Centralised updates | Update your company footer once in the template and every future send uses the new version automatically — without code deployments. |
| Non-technical editing | Marketing and design teams can update template content in the MigoSMTP dashboard without touching application code. |
| Preview and testing | Templates can be previewed with sample variable data directly in the dashboard before being used in production sends. |
Step 1 — Navigate to Templates
- Log in to MigoSMTP via the Rackwave portal SSO.
- Click Templates in the left sidebar (under the Email Management section).
- Click Create Template or New Template.
Step 2 — Fill in Template Details
| Field | Description | Example |
|---|---|---|
| Template Name | Internal name for identifying this template | Order Confirmation v2 |
| Template ID / Slug | URL-friendly identifier used in API calls | order-confirmation-v2 |
| Subject | Default subject line — can contain variables | Your order #{{order_id}} is confirmed |
| From Name | Default sender display name | Your Company Orders |
| Reply-To | Address where replies are directed | support@yourcompany.com |
| Category / Tag | Organise templates by type (transactional, marketing, notification) | transactional |
Step 3 — Build Your Template Content
You have two options for building the template:
- HTML Editor — paste or write raw HTML directly. Best for developers who have an existing HTML design or prefer full control.
- Drag-and-Drop Builder — visual block-based editor. Best for non-technical users or quick template creation without writing HTML.
See the respective articles for detailed guides on each editor.
Step 4 — Add Template Variables
Variables allow you to personalise each email sent using this template. Variables are written as {{variable_name}} anywhere in the subject, HTML body, or plain text body:
<!-- Example template HTML -->
<h2>Hi {{first_name}},</h2>
<p>Your order <strong>#{{order_id}}</strong> has been confirmed.</p>
<p>Total: <strong>{{currency}}{{order_total}}</strong></p>
<p>Expected delivery: {{delivery_date}}</p>
<a href="{{tracking_url}}">Track your order</a>
Define default fallback values for variables in case a value is not provided in the send request — this prevents {{variable_name}} appearing literally in the email:
| Variable | Fallback Value |
|---|---|
| {{first_name}} | Valued Customer |
| {{currency}} | ₹ |
| {{delivery_date}} | within 5-7 business days |
Step 5 — Preview with Sample Data
- After building your template, click the Preview button.
- Enter sample values for each variable in the preview panel.
- The preview renders the template exactly as recipients will see it.
- Toggle between desktop and mobile preview modes.
- Send a test email to your inbox with the sample data to verify rendering in your own email client.
Step 6 — Publish and Use via API
- Click Save & Publish. The template is now available for use.
- Copy the Template ID from the template details page.
- Use the template in your API calls:
POST https://api.migosmtp.com/v1/email/send
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"from": "orders@yourcompany.com",
"to": "customer@example.com",
"template_id": "order-confirmation-v2",
"variables": {
"first_name": "Rahul",
"order_id": "12345",
"order_total": "1,499.00",
"currency": "₹",
"delivery_date":"15 June 2026",
"tracking_url": "https://yourcompany.com/track/12345"
}
}
Template Versioning
MigoSMTP keeps a version history of every template. If a template update breaks something in production, you can roll back to a previous version:
- Open the template in the Templates section.
- Click Version History.
- Select the version you want to restore.
- Click Restore This Version.