> ## Documentation Index
> Fetch the complete documentation index at: https://sendmux.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Template variables

> Insert values from the selected sending account into sender display names, email subjects and bodies.

Use template tags to insert values from the selected sending account into `From`, `Reply-To` and `Sender` display names, the subject, and supported plain-text and HTML bodies.

## Set account variables

**1. Open the account**

Open **Accounts** and edit a sending account. For the managed Amazon SES account, select **Edit variables** from its menu.

**2. Add a key and value**

In **Variables**, add `signature_url` with the URL for that account. Select **Save variables**.

**3. Use the tag**

Insert `[DP_VAR_SIGNATURE_URL]` into your email template. Send a test message and inspect its delivered content and selected provider in **Logs**.

For example, use the variable in an HTML link:

```html theme={null}
<p>Thanks,<br>[DP_FROM_NAME]</p>
<p><a href="[DP_VAR_SIGNATURE_URL]">View my signature</a></p>
```

All provider types support variables. On the shared Amazon SES account, variables are editable while protected connection settings stay locked.

## Key and value limits

Each account can store at most 50 keys. Keys contain 1–64 ASCII characters and must match `^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$`. Start with a lowercase letter; use lowercase letters, digits, and single underscores between nonempty segments. Leading, trailing, and repeated underscores are invalid.

Each value is a string of at most 4,096 Unicode code points. An empty string is valid. To form a tag, uppercase the key and add the `DP_VAR_` prefix inside brackets: `signature_url` becomes `[DP_VAR_SIGNATURE_URL]`.

## Substitution rules

Valid custom tags whose keys are unset become empty strings. Values do not expand template tags inside another value. Body values are inserted raw: Qubrics does not escape HTML or encode URLs. Prepare each value for the context where you insert it.

Subject substitutions remove control characters so a value cannot inject another email header. Body values retain their original content. Substitution supports plain text, HTML, quoted-printable, and base64 message content, including encoded subjects.

### Display names

Built-in `[DP_*]` and custom `[DP_VAR_*]` tags work in the display names of `From`, `Reply-To` and `Sender`, including encoded names. Literal text around each tag is preserved. These names also support substitution when the message has no subject.

For example, use the selected account's configured **From name**:

```text theme={null}
From: "[DP_FROM_NAME]" <hello@example.com>
```

Qubrics removes C0/C1 control characters, including carriage returns and line feeds, from each rendered name and limits it to 255 Unicode code points. Names are encoded for email headers so commas, quotes and angle brackets remain name text.

An empty result becomes an unnamed address. Existing **From name** and **Reply-To name** defaults then apply where they normally would; `Sender` has no default. Substitution preserves each address, its order and any address group. Existing sender address routing and explicit **Reply-To** address overrides still apply. A default **Reply-To name** alone does not collapse a list of reply addresses.

### Excluded locations

Template substitution does not change any address component or any other header, including `To`, `Cc`, `Bcc`, `Message-ID`, `Date`, `Received`, `DKIM-Signature`, `List-*`, `Content-*`, `X-Qubrics-*` and custom `X-*` headers.

These restrictions protect recipient addresses, routing metadata, identifiers and security fields. Excluded means no template substitution; existing header stripping and rewriting still apply.

Qubrics does not substitute template tags inside attachments, signed or encrypted message parts, or attached emails.

Variables belong to the selected provider, not the recipient or credential. Passwords, access tokens, and other connection secrets have no built-in template tags.

## Built-in tags

These seven tags read the selected provider's configured values:

| Tag | Source and fallback |
| - | - |
| `[DP_NAME]` | Account display name; empty if unset. |
| `[DP_USERNAME]` | Provider username; empty if unset. |
| `[DP_FROM_EMAIL]` | Configured **From email**; empty if unset. |
| `[DP_FROM_NAME]` | Configured **From name**; empty if unset. |
| `[DP_REPLY_TO_EMAIL]` | Configured **Reply-To** address; empty if unset. |
| `[DP_TRACKING_DOMAIN]` | Configured **Tracking domain**; empty if unset. |
| `[DP_FROM_DOMAIN]` | Domain from the configured **From email**, then the username if it is an email address; empty if neither has a valid domain. |

The sender-related tags read provider settings. An unset setting does not fall back to the sender supplied in your message.

## Edit several accounts

Select accounts in **Accounts**, then open **Update Variables** and choose a mode:

| Mode | Result |
| - | - |
| **Add or update** | Add supplied keys and overwrite matching keys; retain other keys. |
| **Replace all** | Replace each account's entire map with the supplied map; an empty map clears it. |
| **Remove** | Remove the named keys; retain other keys and values. |

When **Replace all** has no keys, select **Confirm clear** to remove all variables from the selected accounts, or **Cancel clear** to leave them unchanged.

Select **Apply changes** to start the update. Limits apply to each resulting
map, including keys already on the account. Review the reported failures after
a bulk edit, then open an affected account to verify its values.

## Management API

The provider detail response includes `variables`, returning `{}` when unset. Include the optional map when creating a provider or updating it with `PATCH /providers/{public_id}`:

```json theme={null}
{
  "variables": {
    "signature_url": "https://example.com/signatures/team-b"
  }
}
```

Omitting `variables` from a PATCH preserves the existing map. Supplying it replaces the map, and `{ "variables": {} }` clears all keys. Provider list and delivery-group summaries omit variable values; fetch the provider detail when you need them.

## Related guides

> [card] [Delivery groups](https://sendmux.ai/docs/sending/accounts/delivery-groups.md)
>
> Restrict a message to providers in selected groups.

> [card] [Sending accounts](https://sendmux.ai/docs/sending/accounts)
>
> Configure the providers that supply template values.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.