COS Documentation

Search HubSpot Designers Site

Supported Variables

Variables available in all templates

VariableTypeInformation
{{ builtin_body_classes }} str extra classes for the body tag
{{ color_variant("#FFDDFF", -20) }} function Takes a hex color and a brightness offset, will return a new color that is more or less bright. The brightness offset controls the RGB value up or down that each color should be adjusted by.
{{ company_domain }} str The domain for your company
{{ content_id }} An alias for content.id
{{ eastern_dt }} datetime A python datetime object of the current time in the U.S. eastern time zone
{{ favicon_link }} str A <link> tag pointing to your current favicon
{{ home_url }} str The root url of your site
{{ hub_id }} int The hub_id, your HubSpot account ID
{{ hubspot_analytics_tracking_code }} str Includes the analytics tracking code. Use this token only if for some reason you do not want the standard_footer_includes but still want the tracking token.
{{ include_css("custom/shared/styles.css") }} function Takes the template builder path for a CSS template, and will output a proper <link> tag for including the CDN version of that style file
{{ include_javascript("custom/shared/utils.js") }} function Takes the template builder path for a javascript template, and will output a proper <script> tag for including the CDN version of that javascript file
{{ local_dt }} datetime A python datetime object of the current time in the time zone defined in your settings
{{local_time_zone}} str The time zone, as configured in your HubSpot setting
page_meta — The page meta data
{{ page_meta.canonical_url }} Type not known The official url that this page should be accessed at. Usually does not include any query string parameters. Use this for the rel='canonical' tag.
{{ page_meta.html_title }} Type not known The title of the page, as should be used in the <title> tag
{{ page_meta.meta_keywords }} Type not known The keywords for the page, as should be used in the meta keywords tag
{{ page_meta.name }} Type not known The name of the page. The content name for individual content item views, and the group name for blog listing views
{{portal_id}} An alias for hub_id
request — Information about the incoming HTTP request
{{ request.cookies }} Type not known A dictionary of cookie names mapped to cookie values
{{ request.domain }} Type not known The domain used to access this page
{{ request.full_url }} Type not known The URL used to access this page, with the query string
{{ request.path }} Type not known The path component of the URL
{{ request.path_and_query }} Type not known The path and query component of the URL
{{ request.post_dict }} Type not known The POST dat converted to a name->value dictionary
{{ request.query }} Type not known The query string component of the URL
{{ request.query_dict }} Type not known The query string coverted into a name->value dictionary
{{ request.referrer }} Type not known The HTTP referrer, the url of the page that linked to the current page
{{ request.remote_ip }} Type not known The IP address of the visitor
{{ request.scheme }} Type not known Either http or https
{{ request.search_engine }} Type not known The search engine used to find this page, if applicable. Ex: google, aol, live, yahoo, images.google, etc
{{ request.search_keyword }} Type not known The keyword phrase used to find this page, if applicable
{{ site_settings }} SiteSettings The settings for the HubSpot site
{{ standard_footer_include s}} str Add standard footer content such as HubSpot tracking code and any additional footer content from the Content Editor
{{ standard_header_includes }} str Add standard header content such as JQuery and any additional header content from the Content Editor.
{{ to_local_time(content.publish_date) }} function Takes a python datetime object in UTC time and converts it to local time as defined in your account settings
{{ year }} int The current year

Variables available in email templates

VariableTypeInformation
{{ account }} dict The full account record for the person you are sending the email to
{{ background_color }} str Set to background color from settings.
{{ body_border_color }} str Set to body border color from settings.
{{ body_border_color_choice }} str Set to body border color options from settings.
{{ body_color }} str Set to body color from settings.
{{ contact }} dict The full contact record for the person you are sending the email to
content — The email, landing page, or blog post to be rendered
{{ content.absolute_url }} Type not known The full url at which this piece of content can be viewed
{{ content.archived }} Type not known True if the page or email was marked as archived by the user
{{ content.author_email }} Type not known The email address of the content creator
{{ content.author_name }} Type not known The creator of the piece of content
{{ content.author_username }} Type not known The HubSpot username of the content creator
{{ content.campaign }} Type not known The GUID for the marketing campaign that this page or email is associated with
{{ content.campaign_name }} Type not known The name of the marketing campaign this page or email is associated with
{{ content.created }} Type not known A python datetime object for when the content was originally created, in UTC time
{{ content.meta_description }} Type not known The content for the meta description tag
{{ content.name }} Type not known The name of the content, used for internal display and organization
{{ content.publish_date }} Type not known A python datetime object representing when the content was published, in UTC time
{{ content.publish_date_localized }} Type not known A python datetime object representing when the content was published, in the local time as defined in the HubSpot settings
{{ content.published }} Type not known True if the content has been published
{{ content.template_path }} Type not known The path of the template the content is using
{{ content.updated }} Type not known A python datetime object for when the user last updated the content, in UTC time
{{ content.create_page }} Type not known True if there is a web page version of the email
{{ content.email_body }} Type not known The main body of the email
{{ content.emailbody_plaintext }} Type not known The optional override of the plain text email body
{{ content.from_name }} Type not known The from name of the email sender
{{ content.reply_to }} Type not known The reply to address for the email
{{ content.subject }} Type not known The subject of the email
{{ email_body_border_css }} str  
{{ email_body_padding }} str  
{{ email_body_width }} str  
{{ email_main_body_box_shadow_css }} str  
{{ encrypted_contact_id }} str  
{{ primary_accent_color }} str Set to primary accent color from settings.
{{ primary_font }} str Set to primary font from settings.
{{ primary_font_color }} str Set to primary font color from settings.
{{ primary_font_size }} str Set to primary font size from settings.
{{ primary_font_size_num }} int  
{{ request_contact }} RequestContact  
{{ secondary_accent_color }} str Set to secondary accent color from settings.
{{ secondary_font }} str Set secondary font from settings.
{{ secondary_font_color }} str Set to secondary font color from settings.
{{ secondary_font_size }} str Set to secondary font size from settings.
{{ secondary_font_size_num }} int  
{{ subscription_confirmation_url }} str  
{{ subscription_name }} str Add the Email Type the recipient has opted to receive.
{{ unsubscribe_anchor }} str  
{{ unsubscribe_link }} str  
{{ unsubscribe_link_all }} str  
{{ unsubscribe_section }} str  
{{ view_as_page_section }} str Add an automatic link to a webpage version of the email with default anchor text.
{{ view_as_page_url }} str Add a link to a webpage version of the email with your own anchor text.

Variables available in blog post templates

VariableTypeInformation
{{ content.blog }} An alias for content_group
{{ content.comments }} list A list of the comments for the current blog post
content — The email, landing page, or blog post to be rendered
{{ content.absolute_url }} Type not known The full url at which this piece of content can be viewed
{{ content.archived }} Type not known True if the page or email was marked as archived by the user
{{ content.author_email }} Type not known The email address of the content creator
{{ content.author_name }} Type not known The creator of the piece of content
{{ content.author_username }} Type not known The HubSpot username of the content creator
{{ content.campaign }} Type not known The GUID for the marketing campaign that this page or email is associated with
{{ content.campaign_name }} Type not known The name of the marketing campaign this page or email is associated with
{{ content.created }} Type not known A python datetime object for when the content was originally created, in UTC time
{{ content.meta_description }} Type not known The content for the meta description tag
{{ content.name }} Type not known The name of the content, used for internal display and organization
{{ content.publish_date }} Type not known A python datetime object representing when the content was published, in UTC time
{{ content.publish_date_localized }} Type not known A python datetime object representing when the content was published, in the local time as defined in the HubSpot settings
{{ content.published }} Type not known True if the content has been published
{{ content.template_path }} Type not known The path of the template the content is using
{{ content.updated }} Type not known A python datetime object for when the user last updated the content, in UTC time
{{ content.blog_post_author }} Type not known The author object associated with this blog post. The following properties can be accessed from the blog_post_author object: display_name, slug, email, bio, website, twitter, facebook, linkedin, and google_plus
{{ content.comment_list }} Type not known The list of comments associated with the blog post. The following properties can be accessed from each comment object: user_name, user_email, user_website, comment, created_date_localized
{{ content.featured_image }} Type not known A string representing the url of the image marked as featured when the blog was published. This is also the image denoted in Twitter cards and OpenGraph Tags.
{{ content.next_post_featured_image }} str The url of the featured image of the next blog post, if one exists.
{{ content.next_post_name }} str The name of the next blog post, if one exists.
{{ content.next_post_slug }} str The url slug of the next blog post, if one exists.
{{ content.post_body }} Type not known The body of the blog post
{{ content.post_summary }} Type not known The blog post summary
{{ content.previous_post_featured_image }} str The url of the featured image of the previous blog post, if one exists.
{{ content.previous_post_name }} str The name of the previous blog post, if one exists.
{{ content.previous_post_slug }} str The url slug of the previous blog post, if one exists.
{{ content.publish_date_localized }} Type not known A string representing the date/time when the blog post was published, formatted according to the blog's language and date formatting settings.
{{ content.topic_list }} Type not known The list of topic objects associated with the blog post. The following properties can be accessed from each topic object: name and slug
content_group — The blog
{{ content_group.description }} Type not known A blog description
{{ content_group.header }} Type not known The header of the blog
{{ content_group.html_title }} Type not known The title of this blog as it should appear in the <title> tag
{{ content_group.public_title }} Type not known The title of this blog as it should appear at the top of rendered pages
{{ content_group.slug }} Type not known The path to this blog
{{ content_group.allow_comments }} Type not known  
{{content.content_group_id}} An alias for content_group.id
{{content.group}} An alias for content_group

Variables in blog post, and blog listing templates

VariableTypeInformation
{{content.blog_author}} BlogAuthor The author object whose blog posts are listed in this view. The following properties can be accessed from the blog_author object: display_name, slug, email, avatar, bio, website, twitter, facebook, linkedin, and google_plus
{{ content.contents }} list A list of the blog post content objects for the current view
{{ content.last_page_num }} int The integer index of the last page of blog posts in the view
{{ content.current_page_num }} int The integer index of the current page of blog posts in the view
{{ content.next_page_num }} int The integer index of th next page of blog posts in the view
{{ content.simple_list_page }} bool A boolean to indicate whether the requested page is the 'all' page containing links to all blog posts

Variables available in landing page templates

VariableTypeInformation
content — The email, landing page, or blog post to be rendered
{{ content.absolute_url }} Type not known The full url at which this piece of content can be viewed
{{ content.archived }} Type not known True if the page or email was marked as archived by the user
{{ content.author_email }} Type not known The email address of the content creator
{{ content.author_name }} Type not known The creator of the piece of content
{{ content.author_username }} Type not known The HubSpot username of the content creator
{{ content.campaign }} Type not known The GUID for the marketing campaign that this page or email is associated with
{{ content.campaign_name }} Type not known The name of the marketing campaign this page or email is associated with
{{ content.created }} Type not known A python datetime object for when the content was originally created, in UTC time
{{ content.meta_description }} Type not known The content for the meta description tag
{{ content.name }} Type not known The name of the content, used for internal display and organization
{{ content.publish_date }} Type not known A python datetime object representing when the content was published, in UTC time
{{ content.publish_date_localized }} Type not known A python datetime object representing when the content was published, in the local time as defined in the HubSpot settings
{{ content.published }} Type not known True if the content has been published
{{ content.template_path }} Type not known The path of the template the content is using
{{ content.updated }} Type not known A python datetime object for when the user last updated the content, in UTC time
{{request_contact}} RequestContact