Skip to main content
HubSpot templates can use a host of predefined variables that can be used to render useful website and email elements. This page is a reference listing of those variables. Learn more about creating your own variables in a HubL template or module. While most of the variables listed on this page are optional, there are a few variables that are required for creating emails and pages from your templates.
The variables listed below can be used individually by wrapping them in the }} delimiter as noted on the variables and macros page. You can optionally use these variables with other parts of the HubL templating language such as loops, filters, functions, tags, and more.

Variables available in all templates

The HubL variables below can be used in email, page, or blog templates. To see additional information about what these variables output, you can use the pprint filter, as shown below.

Email variables

Below are the HubL variables that can be used in email templates. Some variables, such as the color and font settings variables, can be used in other content types if you want to reference your email color and font settings elsewhere.

Required email template variables

To be CAN-SPAM compliant, all emails sent through HubSpot require certain company and opt-out information. This information is set by the following variables, which must be included. Values for these tokens are pulled from the account’s marketing email settings. There are additional email variables that are optional which are listed further down this page.

Color and font settings

There are several basic color and font controls in your marketing email settings that can be printed to emails. Where noted, you can use some of these variables on page and blog templates by adding site_settings. before the variable.

Email content

Private content email variables

The following list of variables are only available inside of email templates that are used for private content email templates.

Website page variables

The following variables are available for site pages, landing pages, system pages, and blogs.

Required page template variables

To publish a coded file as an editable page or blog template, the following variables must be included. To publish an HTML file without these variables, to use within another template, include isAvailableForNewContent: false in the template annotations.

Content and contact variables

HTTP request variables

The following variables print information about the HTTP page request. Some of these variables will prevent page caching due to needing to dynamically populate data at page load. Learn more about page prerendering and JavaScript alternatives.

Blog variables

The following variables are available for blog templates. Some variables are only available for post listings, while others may only be available for blog posts.
Variables related to blog tags (e.g., content.tag_list), include an alias of topic for older implementations (e.g., content.topic_list).

CRM object dynamic pages

The following variables are used to build dynamic pages with CRM objects. These variables are only available for CRM object dynamic pages.

HubDB variables

The following variables are used to build dynamic pages with HubDB. These variables are only available for HubDB dynamic pages. The following variables are available to use on the object returned by the HubL menu function.

In-app editor and preview variables

You can use the following variables to check if the content is being rendered in the content editor or previewer. For example, you may want to use these to prevent running code in the editor while still running the code on live pages.
Last modified on May 27, 2026