Appearance
Rule.io SDK / rcml/src / createRcmlDocumentElement
Function: createRcmlDocumentElement()
createRcmlDocumentElement(
options):RcmlDocument
Defined in: rcml/src/email/create-rcml-element.ts:1173
Build the <rcml> document root — wraps a pre-built <rc-head> + <rc-body> pair into the top-level document shape.
Name deliberately disambiguated from the legacy createRCMLDocument in ../elements.ts: this factory takes an explicit head + body (no brand-style / sections shorthand).
Parameters
options
options.head and options.body are the two document children in order. Both must be produced by createHeadElement / createBodyElement.
Returns
A typed RcmlDocument node, ready for rcmlToXml or validateEmailTemplate.
Throws
When the supplied head/body nodes are not structurally valid children of <rcml>.
Example
ts
createRcmlDocumentElement({
head: createHeadElement({ children: [] }),
body: createBodyElement({ children: [createSectionElement({ children: [...] })] }),
})