Email Templates
Templates let you create reusable email layouts with variable placeholders. Define the structure once, then send personalized emails by passing different variable values at send time.
Creating a Template
- Go to Templates in the left sidebar
- Click Create Template
- Fill in the template details:
- Name — A descriptive name (e.g.,
Ticket Assigned Notification) - Subject — Subject line, supports variables (e.g.,
Ticket #{{ticket_id}} has been assigned) - HTML — HTML body with variables
- Plain Text — Optional text fallback with variables
- Name — A descriptive name (e.g.,
- Click Save
Relay auto-detects variables in your HTML and text content. Any {{variable_name}} pattern is extracted and listed in the template's variable list.
Variable Syntax
Use double curly braces for variables: {{variable_name}}
Variables work in the subject, HTML body, and plain text body:
<h1>Hello {{client_name}},</h1>
<p>Your ticket <strong>#{{ticket_id}}</strong> has been assigned to {{technician}}.</p>
<p>View your ticket: <a href="{{ticket_url}}">Open Ticket</a></p>
When sending with this template, pass the variable values:
{
"template_id": "tmpl_abc123",
"variables": {
"client_name": "Acme Corp",
"ticket_id": "1234",
"technician": "Sarah",
"ticket_url": "https://portal.yourmsp.com/tickets/1234"
}
}
{{ticket_id}} appears in the email). Always verify all variables are mapped before production use.Editing a Template
- Click a template card to open it
- Edit the name, subject, HTML, or plain text
- Click Save
Changes apply to all future sends using this template. Previously sent emails are not affected.
Cloning a Template
Click the clone action on any template to create a copy. The clone gets a (Copy) suffix in its name. Useful for creating variations of an existing template.
Test Sends
Before using a template in production, send a test:
- Open the template
- Click Send Test
- Enter a test recipient email address
- Provide sample variable values
- Click Send
The test email sends immediately with the provided variables. Check your inbox and verify formatting, variable substitution, and rendering across email clients.
Template Best Practices
Always include a plain text fallback. Some recipients use text-only email clients or have HTML disabled. The plain text version ensures everyone can read your emails.
Keep variables descriptive. Use {{client_company_name}} instead of {{name}} to avoid confusion when templates have multiple name-like variables.
Use inline CSS. Many email clients strip <style> blocks. Inline your CSS for consistent rendering:
<p style="font-family: Arial, sans-serif; color: #333;">Hello {{client_name}}</p>
Test before deploying. Always use the test send feature before pointing a production integration at a new or modified template.
Deleting a Template
Click the delete action on a template and confirm. Deletion is permanent. Any integration referencing the deleted template's ID will receive a 404 error on the next send attempt.
API Reference
Templates can also be managed via the API with a key that has the manage-templates scope:
| Method | Endpoint | Description |
|---|---|---|
GET | /api/templates | List all templates |
POST | /api/templates | Create a template |
GET | /api/templates/{id} | Get template details |
PATCH | /api/templates/{id} | Update a template |
DELETE | /api/templates/{id} | Delete a template |
POST | /api/templates/{id}/test | Send a test email |