# Message templates

Section: Team settings. Part of the [API reference](https://developer.yoprint.com/reference.md). Web page: https://developer.yoprint.com/reference/message-templates/

This page and all 11 operation pages, in 2 files: https://developer.yoprint.com/llms/message-templates.txt (operations 1 to 7), https://developer.yoprint.com/llms/message-templates-2.txt (operations 8 to 11)

Reusable email and text messages for sales orders, quotes and purchase orders, with placeholders and attachments.

## Operations (11)

- [Create a message template](https://developer.yoprint.com/reference/message-templates/v2-message-template-store.md): `POST /v2/api/store/{team_slug}/setting/message_template`. Saves a new email or text message template for sales orders, quotes or purchase orders.
- [List message templates](https://developer.yoprint.com/reference/message-templates/v2-message-template-index.md): `GET /v2/api/store/{team_slug}/setting/message_template`. Returns all of the team's message templates: the system ones (the emails YoPrint sends for new sales orders, quotes and purchase orders) and the ones your team saved, with their raw subject and body…
- [List message template types](https://developer.yoprint.com/reference/message-templates/v2-message-template-config-index.md): `GET /v2/api/store/{team_slug}/setting/message_template/config`. Returns every kind of message template YoPrint supports, with its default name, subject and body, its placeholders and the attachments it can carry.
- [Get a message template](https://developer.yoprint.com/reference/message-templates/v2-message-template-show.md): `GET /v2/api/store/{team_slug}/setting/message_template/{hash_id}`. Returns one message template with its raw subject and body (placeholders not filled in), its placeholders and its attachments.
- [Get a message template type](https://developer.yoprint.com/reference/message-templates/v2-message-template-config-show.md): `GET /v2/api/store/{team_slug}/setting/message_template/config/{type}`. Returns one template type, by its `type` value (for example `sales_order_message`): its default name, subject and body, placeholders and supported attachments.
- [Preview template text](https://developer.yoprint.com/reference/message-templates/v2-message-template-preview.md): `POST /v2/api/store/{team_slug}/setting/message_template/preview`. Renders template text you are writing, before you save it: send the `type`, `body` and optional `subject`.
- [Update a message template](https://developer.yoprint.com/reference/message-templates/v2-message-template-update-put.md): `PUT /v2/api/store/{team_slug}/setting/message_template/{hash_id}`. Changes a template's name, subject, body or button settings.
- [Touch a message template](https://developer.yoprint.com/reference/message-templates/v2-message-template-update-patch.md): `PATCH /v2/api/store/{team_slug}/setting/message_template/{hash_id}`. Use PUT to change a message template.
- [Fill in a template for a record](https://developer.yoprint.com/reference/message-templates/v2-message-template-compile.md): `POST /v2/api/store/{team_slug}/setting/message_template/compile`. Fills a saved template's placeholders from one record and returns the finished `subject` and `body`, with the template's attachments.
- [Send a template for a record](https://developer.yoprint.com/reference/message-templates/v2-message-template-send.md): `POST /v2/api/store/{team_slug}/setting/message_template/send` (spends money). Fills a saved template from one record and sends it now.
- [Delete a message template](https://developer.yoprint.com/reference/message-templates/v2-message-template-destroy.md): `DELETE /v2/api/store/{team_slug}/setting/message_template/{hash_id}`. Deletes one of your saved templates for good.
