Email Templates

Altermail lets you configure a branded email template in the Templates page. Once a template is active on your account, you no longer need to build HTML for every request.

How it works

  • •No active template: mailBodyHtml is required.
  • •Active template + no mailBodyHtml: the template renders automatically, using mailBodyText as the body content.
  • •Active template + mailBodyHtml provided: the template is bypassed and your HTML is sent as-is.

When using a template, pass your email body as plain text in mailBodyText. The text is automatically converted to styled paragraphs inside the template. Blank lines create paragraph breaks; consecutive lines within a block are joined with a line break.

// With an active template, just send plain text content:
{
  "email": "customer@example.com",
  "fromEmail": "hello@yourdomain.com",
  "subject": "Order Confirmed",
  "mailBodyText": "Hi Sarah,\n\nYour order #1042 has been confirmed and will ship within 2 business days.\n\nThank you for shopping with us!\n\nBest regards,\nThe Team"
}

// Override the template for this specific send:
{
  "email": "customer@example.com",
  "fromEmail": "hello@yourdomain.com",
  "subject": "Custom Layout Email",
  "mailBodyHtml": "<table>...</table>",
  "mailBodyText": "Fallback plain text."
}

Display name & footer customisation

In the Templates page you can override two template placeholders per saved preference:

  • •Display name: the business/brand name shown inside the template (replaces {{businessName}}). Defaults to your account business name. Useful when you manage multiple brands under one account.
  • •Footer text: the line shown in the template footer (replaces {{footerText}}). Defaults to Sent via Altermail · [display name]. Set this to your own tagline or legal text.

Both fields are saved with the template preference and apply to all emails sent using that template.

Template limitations

  • •Templates support plain text content injected as paragraphs. Markdown syntax (e.g. **bold**) is not processed.
  • •Images, custom colours, and layout per-send are not supported; those are part of the template design.
  • •For complex layouts (tables, multi-column, per-email images), pass mailBodyHtml directly to bypass the template.
  • •Raw HTML tags written inside mailBodyText (e.g. <a href="...">link</a>) will render in the email, but this is not the intended use.