---
title: "Send an email using a Template"
method: POST
path: "/email/withTemplate"
tags: ["Sending API", "Templates API"]
---

# Send an email using a Template

`POST /email/withTemplate`

## Headers

- `X-Postmark-Server-Token` string, required

## Request body

- EmailWithTemplateRequest
  - `TemplateId` integer, required — Required if 'TemplateAlias' is not specified.
  - `TemplateAlias` string, required — Required if 'TemplateId' is not specified.
  - `TemplateModel` object, required
  - `InlineCss` boolean
  - `From` string, email, required
  - `To` string, email, required
  - `Cc` string, email
  - `Bcc` string, email
  - `Tag` string
  - `ReplyTo` string
  - `Headers` MessageHeader[]
    - `Name` string — The header's name.
    - `Value` string — The header's value.
  - `TrackOpens` boolean — Activate open tracking for this email.
  - `TrackLinks` 'None' | 'HtmlAndText' | 'HtmlOnly' | 'TextOnly' — Replace links in content to enable "click tracking" stats. Default is 'null', which uses the server's LinkTracking setting'.
  - `Attachments` Attachment[]
    - `Name` string
    - `Content` string
    - `ContentType` string
    - `ContentID` string

## Response `200`

OK

- SendEmailResponse — The standard response when a postmark message is sent
  - `To` string
  - `SubmittedAt` string, date-time
  - `MessageID` string
  - `ErrorCode` integer
  - `Message` string

## Other responses

- `422` — An error was generated due to incorrect use of the API. See the Message associated with this response for more information.
- `500` — Indicates an internal server error occurred.

---

[API](https://skmtc.dev/postmarkapp/apis/postmark-api.md) · [All operations](https://skmtc.dev/postmarkapp/apis/postmark-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/postmarkapp/postmark-api/revisions/fdae25f55e2e/schema)
