Skip to content

<rc-head>

<rc-head> is the metadata container for an email template. An empty head is valid — the renderer applies built-in defaults.

Attributes

None.

Children

All children are optional.

ElementDescription
<rc-brand-style>Loads a saved brand style by ID.
<rc-attributes>Sets default attribute values for content elements.
<rc-preview>Preheader text shown in inbox previews.
<rc-class>Named groups of attributes, applied like style classes.
<rc-font>Declares a web font for use in the template.
<rc-plain-text>Plain-text fallback for clients that cannot render HTML.

Parents

JSON

json
{
  "tagName": "rc-head",
  "children": [
    { "tagName": "rc-brand-style", "attributes": { "id": "99999" } },
    { "tagName": "rc-preview", "content": "See inside for 20% off" }
  ]
}

XML

xml
<rc-head>
  <rc-brand-style id="99999"></rc-brand-style>
  <rc-preview>See inside for 20% off</rc-preview>
</rc-head>

Building

Templates can be built using factory functions from @rule/rcml, or the JSON structure above can be generated directly by an AI model — pass rcmlSpec as context when prompting.

typescript
import { createHeadElement, createBrandStyleElement, createPreviewElement } from '@rule/rcml';

const head = createHeadElement({
  children: [
    createBrandStyleElement({ attrs: { id: '99999' } }),
    createPreviewElement({ content: 'See inside for 20% off' }),
  ],
});

API Reference