# save_site_message_template

Source: https://modulify.ai/docs/mcp/messages/save-site-message-template

Creates a text template of the site's own, or changes the text of one, and sends it for review.

- Title: Save a text template
- Scope: `config:write`
- Access: Makes changes

Leave `key` out to create a template, with a name no other template on the site has, up to 40 characters, and a site can have 20 of its own. Pass `key` to change a template that is `initial`, `rejected` or `disabled`, and a built-in one keeps its name. Write the text with each placeholder in double braces, such as `Hi {{name}}, your order {{order}} is ready at {{site}}. Reply STOP to opt out.`, and give a realistic example for each in `examples`. A text that starts or ends with a placeholder, has two placeholders side by side, or has too few words around them is refused, and a placeholder named `link` or `url` needs a full `https://` link as its example. The text can be 1,024 characters with 10 placeholders. `category` is `UTILITY`, the default, for an update about something the person did or asked for, or `MARKETING` for a promotion, which must have the word STOP in it, such as `Reply STOP to opt out.` The review refuses an update with an offer or a discount in it, so the tool tells the client to keep updates factual, name the site with `{{site}}`, write each language as its own template and use the built-in verification code for sign-in codes. Changing a template without `category` keeps its category, and a built-in template always keeps its own. Before anything goes for review, the text is checked against the review rules, and a text that would likely be rejected, or that texting cannot be used for, such as pretending to be a bank or asking for card details, is refused with the reasons and nothing is saved, so fix every reason before calling again. `submitted` false means it was saved but sending it for review failed, with the reason, and `retrying` true means that was for a reason outside the template, so it is sent for review again on its own and needs nothing more. See [Your own templates](https://modulify.ai/docs/built-in/messages#your-own-templates).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |
| `key` | string | No | The key of the template to change, from `list_site_message_templates`. Leave it out to create a new one. |
| `name` | string | No | What to call a new template, such as Pickup ready. Ignored for a built-in template. |
| `text` | string | Yes | The text with its `{{placeholders}}`. |
| `examples` | object | Yes | An example value for each placeholder, keyed by its name. |
| `category` | string | No | `UTILITY` for an update or `MARKETING` for a promotion. Left out, a new template is `UTILITY` and a changed one keeps its category. |