ContentBlockbyName

Returns content contained in the specified stored content block or code snippet from Content Builder, including the Image Block type. These functions support email messages only. For text-only parts of the email, such as From Address, From Name, or Subject Line, reference the code snippet block.

ContentBlockbyName(1, 2, 3, 4, 5)

OrdinalTypeDescription
1stringRequiredName of the content block to return
2stringName of the impression region to start
3booleanDetermines whether the function returns an error when the system cannot locate the specified content area or returns an invalid content area. A value of true returns an error. A value of false does not return an error. Defaults to true.
4stringDefault content to return if an error occurs. Defaults to an empty string.
5numericOutput parameter that returns the status of the call. A value of 0 indicates the function found the content area and successfully rendered the content. A value of -1 indicates either no content or an invalid content area.

This example returns the Weekly Portfolio content block from Content Builder.

This example returns the Opt Out Form 2 content block from Content Builder. The function will not return an error if one occurs, and it returns the Opt Out Form Default content block if it cannot find the specified content.

This example concatenates the Opt Out Form content block from Content Builder with an uppercase version of the culture code value returned from the IIF function. The function will not return an error if one occurs, and it returns the Opt Out Form EN-US content block if it cannot find the specified content.