Skip to main content

Templates Overview

Mailofly Templates allow you to decouple email design and copywriting from your application code. Design responsive templates in the dashboard, test them with live preview data, and trigger them with a single API call by passing a template_id and dynamic merge variables.

Why Use Mailofly Templates?

  • Code Separation: Marketing and design teams can edit copy, layout, and colors without redeploying backend code.
  • Reusable Layouts: Create consistent headers, footers, and brand styles across all transactional and marketing messages.
  • Dynamic Personalization: Use Handlebars-style merge tags ({{first_name}}, {{order_id}}) to inject user data at send time.
  • Version Safety: Test changes in draft mode before publishing to production.

Triggering a Template via API

Instead of passing raw html in your API payload, pass template_id and variables:

Next Steps

Related topics

Introduction