mailnix / Templates

    Sending

    Templates

    Saved, versioned email templates with render preview. Design a message once, send it by handle with per-send variables, and update it without touching your integration.

    The model

    • Slug is the stable handle (order-confirmation). Sends can reference a template by id or slug.
    • Versioned: every save creates a new version; sends can pin a version or follow the latest.
    • Schema-validated: declare a variables schema and mailnix validates render inputs at save time and send time.
    • Three bodies: subject template, plain-text template, and an optional HTML template.
    • Template syntax is Sprig (Go templates plus the Sprig helper functions): {{ .name }}, conditionals, loops, formatting helpers.

    Free plans store up to 3 templates; paid plans are unlimited.

    Sending with a template

    REST (POST /v1/messages) and the MCP tool email_send_test accept template_id or template_slug, a template_vars object, and an optional template_version pin. The rendered subject and bodies replace the inline ones.

    MCP tools

    • email_template_create(slug, name, subject_tmpl, text_tmpl?, html_tmpl?, schema_json?)
    • email_template_list()
    • email_template_versions_list(template_id, limit?) for history and diffing
    • email_template_render_preview(template_id, variables) dry-run render, no send
    • email_template_delete(id) removes the template and all versions

    Templates power form replies

    A template saved here also appears in the mailnix Forms reply composer and can be passed to form_reply_draft_create / form_reply_send. Form-reply templates render against the submission: {{ .fields.<field_key> }} and {{ .form.name }}. Declare both fields and form in the variables schema so save-time validation passes.