ContentAreaByName()

Returns content from a classic content area.

This function retrieves classic content areas, which are no longer supported in Marketing Cloud Engagement. As a result, this function doesn't retrieve any content and shouldn’t be used. This documentation is retained for historical purposes.

To retrieve content blocks created in Content Builder, use the ContentBlockByName() function.

ContentAreaByName(contentAreaName, impressionRegionName, boolErrorOnMissingContentArea, errorMessage, statusCode)

The ContentAreaByName() function has five parameters:

  • contentAreaName (string): Required. The name of the content area to retrieve.
  • impressionRegionName (string): The name of the impression region to associate with the content area.
  • boolErrorOnMissingContentArea (boolean): If true, the function returns an error if the content area can’t be found. If false, the function doesn’t return an error. The default value is true.
  • errorMessage (string): The content to return if an error occurs while retrieving the content area.
  • statusCode (number): An output variable that contains the exit code of the function. 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.