Skip to main content

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

  1. Go to Templates in the left sidebar
  2. Click Create Template
  3. 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
  4. 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"
}
}
ℹ️Variables that aren't provided in the send request remain as literal text (e.g., {{ticket_id}} appears in the email). Always verify all variables are mapped before production use.

Editing a Template

  1. Click a template card to open it
  2. Edit the name, subject, HTML, or plain text
  3. 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:

  1. Open the template
  2. Click Send Test
  3. Enter a test recipient email address
  4. Provide sample variable values
  5. Click Send

The test email sends immediately with the provided variables. Check your inbox and verify formatting, variable substitution, and rendering across email clients.

💡Test with multiple email clients (Gmail, Outlook, Apple Mail) to catch rendering differences. HTML email support varies significantly across 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:

MethodEndpointDescription
GET/api/templatesList all templates
POST/api/templatesCreate 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}/testSend a test email