--- 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] [subject] [trackimage] [composing name(main) mime(html)]  [part id(0) mime(html) title(introduction)]    

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/input) label(Headline) varname(headline) showmime(html)]      A relevant headline    [/part]  

[/part] ``` ## Widget types Widgets are nested `[part]` elements inside a `mime(complex/composition)` article. They expose selected content or properties to editors while the surrounding HTML remains controlled by the template. Use a unique `varname` within the containing article. | Widget MIME type | What editors can change | Typical use | | --- | --- | --- | | `complex/input` | One line of plain text | Headlines, labels, prices, or short values | | `complex/simpletextarea` | Multiple lines of plain text | Copy whose formatting is controlled entirely by the template | | `complex/textarea` | Formatted rich text | Editorial copy with permitted links and text formatting | | `complex/link` | Link text, target, title, and configured presentation | Text links and calls to action | | `complex/image` | Image source and configured image properties | Unlinked editorial or product images | | `complex/imagelink` | Image plus its optional link | Linked hero images, banners, and product tiles | | `complex/switchimage` | Images and links for configured device classes | Device-dependent image output | | `complex/switchlink` | Link targets for configured device classes | Device-dependent destinations, such as app-store links | | `complex/list` | Repeatable items that can be added, removed, and sorted | Benefits, navigation entries, product rows, or other repeatable content | | `complex/index` | A generated list of eligible articles | Linked tables of contents for longer messages | ### Input Use `complex/input` for a single-line value. The surrounding HTML controls its visual presentation. ```

[part mime(complex/input) label(Headline) varname(headline) showmime(html)]  A relevant headline [/part]

``` ### Simple textarea Use `complex/simpletextarea` for multi-line plain text without rich-text formatting controls. ```

[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)]  Product overview [/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)]      Elaine   [/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()  listitemheader(
  • ) listitemfooter(
  • )  listitem_0(First benefit) listitem_1(Second benefit)]   [/part] ``` ### Index Use `complex/index` to render linked entries for eligible articles in an indexed composing box. Article attributes such as `indexlabel`, `indexkey`, and `hideindex` control participation. ``` [part mime(complex/index) label(Table of contents) varname(toc)  listheader()  listitemheader(
  • ) listitemfooter(
  • )  showmime(html)] [/part] ``` > [!NOTE] > Note > > These examples show the core widget structure. Optional attributes, editor settings, client identifiers, tracking types, and rendered HTML can differ by tenant and template. Preserve known working attributes or confirm the target configuration instead of inventing values. A stored or top-level content article requires `title(...)`. Nested widgets and `mime(subject)` parts do not. The form `mime(input)` is invalid. ## Personalization and realtime resolution Available fields are inserted in brackets, for example `[c_prename]`. During rendering, Elaine can combine CRM and profile data with event or transaction context, Datastore values, recommendations, product and content information, intent signals, and values prepared by Business Rules. Depending on the integration design, additional data can be queried live, prepared before rendering, or provided through intelligent caching. Therefore, “real time” describes resolution during the rendering and decision process; it does not mean that every connected source is queried live for every recipient. ## Conditional content ``` [part id(0) mime(html) title(premium_offer) condition(c_status=premium)]  

    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)