Handlebar Helper Function: GetContentBlock
Retrieve and render a content block within a template.
This helper is available in the Summer ’26 release of Marketing Cloud Next (API version 67.0).
| Parameter | Type | Description |
|---|---|---|
key | String | Required. The unique identifier of the content block to retrieve. |
The function returns the rendered content of the specified content block. For HTML rendering contexts, it returns the HTML part of the content. For other contexts, it returns the text part. If the content block can’t be retrieved, the function throws an exception.
The helper automatically extracts the locale from the rendering context. If any language-specific content variants are available, the function retrieves them based on the locale information.
This example retrieves and renders a content block.
The function throws an exception if the specified content block doesn’t exist, so it’s a good idea to provide a fallback. This example provides a default if the content block isn’t found.
It’s often useful to render specific content blocks based on the properties of the recipient. This example conditionally includes a content block when a variable evaluates to true.