--- title: "Elaine Markup Language (EML) reference" slug: "elaine-markup-language" updated: 2026-07-31T06:51:16Z published: 2026-07-31T06:51:16Z canonical: "help.elaine.io/elaine-markup-language" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.elaine.io/llms.txt > Use this file to discover all available pages before exploring further. # Elaine Markup Language (EML) reference Elaine Markup Language (EML) extends HTML and other message content with structure, editable components, personalization fields, conditions, language variants, tracked links, and content variants. It is the technical foundation for reusable, privacy-aware, real-time hyperpersonalization in Elaine templates. > [!NOTE] > Note > > EML templates use tenant-specific data fields, salutation IDs, Datastore fields, Business Rules, and tracking conventions. Confirm these values in the target tenant instead of copying example identifiers unchanged. ## Core syntax ``` [tag attribute(value) other(value)] content [/tag] ``` Attribute values are not quoted. For example, `mime(html)` is valid and `mime("html")` is not. Widget MIME types always use the `complex/` prefix, such as `mime(complex/input)`. ## Structural elements | Element | Purpose | | --- | --- | | `[struct]...[/struct]` | Optional outermost language variant containing one complete document. | | `[composing]...[/composing]` | Managed content area containing articles. | | `[part]...[/part]` | Content article, inline condition, subject, composition, or nested editor widget. | ``` [part mime(subject)]Your personal update[/part]
Hello [c_prename],
[/part] [/composing] ``` ## Articles and widgets Normal HTML articles use `mime(html)`. Controlled editor components use an outer `mime(complex/composition)` article and nested widgets such as `complex/input`, `complex/textarea`, `complex/link`, or `complex/imagelink`. ``` [part id(0) mime(complex/composition) showmime(html) title(hero)][part mime(complex/simpletextarea) label(Editorial) varname(editorial) showmime(html)] First line Second line [/part]
``` ### Rich-text textarea Use `complex/textarea` when editors need permitted formatting such as paragraphs, emphasis, or links. Available toolbar functions can be restricted by configuration. ``` [part mime(complex/textarea) label(Body) varname(body) showmime(html)]Editable rich text.
[/part] ``` ### Link Use `complex/link` for an editable tracked text link. `linktype` follows the tenant's tracking conventions. ``` [part mime(complex/link) label(Call to action) varname(cta) linktitle(Learn more) linktype(info) linkurl(https://www.elaine.io) showmime(html)] Learn more [/part] ``` ### Image Use `complex/image` for an editable image that does not require a surrounding link. ``` [part mime(complex/image) label(Hero image) varname(hero_image) imageurl(https://example.com/hero.jpg) imagealt(Product overview) showmime(html)]
[/part]
```
### Image link
Use `complex/imagelink` when editors should manage an image and its optional tracked destination together.
```
[part mime(complex/imagelink) label(Linked hero) varname(linked_hero)
imageurl(https://example.com/hero.jpg)
linkurl(https://www.elaine.io) linktype(info) showmime(html)]
[/part]
```
### Switch image
Use `complex/switchimage` to configure different image resources for supported device classes. The configured `clients`, URL order, and output markup must correspond.
```
[part mime(complex/switchimage) label(Responsive hero) varname(responsive_hero)
clients(desk,mobile)
imageurls(https://example.com/hero-desktop.jpg,https://example.com/hero-mobile.jpg)
linkurls(https://www.elaine.io,https://www.elaine.io)
linktype(info) showmime(html)]
...configured device-dependent image output...
[/part]
```
### Switch link
Use `complex/switchlink` when the visible call to action remains consistent but its destination depends on the detected device class.
```
[part mime(complex/switchlink) label(Get the app) varname(app_link)
clients(desk,ios,android)
linkurls(https://example.com/app,https://apps.apple.com/app,https://play.google.com/store)
linktitle(Get the app) linktype(info) showmime(html)]
Get the app
[/part]
```
### List
Use `complex/list` for repeatable and sortable items. Header and footer attributes define the wrapper; item header and footer attributes define each entry.
```
[part mime(complex/list) label(Benefits) varname(benefits) showmime(html)
listheader(Your premium offer.
[/part] ``` Conditions support equality and ordered comparisons, string matching, logical AND and OR, negation, exclusive OR, and grouped expressions. Reserved characters inside EML attributes must be escaped. For example, `[` becomes `(5B)`, `]` becomes `(5D)`, `(` becomes `(28)`, and `)` becomes `(29)`. ## AIDO variants The `testingvariant(...)` attribute is valid only on normal, non-`complex/...` content parts. Do not add it to complex composition articles or widgets. ``` [part id(0) mime(html) title(offer_a) testingvariant(0:0)]Benefit-led content.
[/part] [part id(0) mime(html) title(offer_b) testingvariant(0:1)]Curiosity-led content.
[/part] ``` ## Agent-ready instructions Want to create or validate EML from an AI assistant, coding agent, or other AI environment? Download the compact instruction file and add it to the agent's context: [Download the Elaine EML instructions for AI agents (Markdown)](https://cdn.document360.io/8c4175bc-f415-4eb1-9ffb-892cfd049f4e/Images/Documentation/elaine-eml-agent-instructions-v1.md?sv=2026-02-06&spr=https&st=2026-11-24T09%3A32%3A43Z&se=2026-11-24T10%3A32%3A43Z&sr=b&sp=r&sig=iEyWJsnhO4MwUVEt7DnjWXXYMfYygmdC9yhc7wW7PJ8%3D) The downloadable file contains strict generation rules, examples, condition operators, escaping rules, an HTML-to-EML conversion procedure, and an agent validation checklist. ## Related topics - [Templating for real-time hyperpersonalization](/new-public-docs/docs/en/templating-hyperpersonalization) - [Real-time hyperpersonalization with Elaine](/new-public-docs/docs/en/personalize-message-content) - [Articles, widgets, and reusable content](/new-public-docs/docs/en/articles-widgets-reusable-content)