Quote template variables [BETA]

Last updated:

This functionality is in beta and requires your account to be ungated. The primary purpose of custom quote templates is to enable quotes to have proper company brand styling. The quote tool supports some but not all of the functionality that CMS templates support. By participating in this beta you agree to our beta terms. We encourage beta participants to join the beta group on the forums to provide feedback.

Custom quote templates have access to quote data and some associated objects directly from the templates. The data available depends on data you have in your CRM, as well as data added to the quote itself.

In the "cms-quote-theme" provided in the @hubspot folder, we have mock data to make it easier to preview the template during development.

If you open the bold.html or minimal.html templates you will find this code block at the top.

HubL
{% from '../imports/mock_data.html' import SAMPLE_TEMPLATE_DATA as mock_data %}
{% from '../imports/module_defaults.html' import MODULE_DEFAULTS as module_defaults %}
{% set QUOTE = template_data.quote || mock_data.quote %}
{% set CURRENCY = QUOTE.hs_currency || 'USD' %}
{% set LOCALE = QUOTE.hs_locale || 'en-US' %}
{% set ASSOCIATED_OBJECTS = QUOTE.associated_objects %}
{% set LINE_ITEMS = ASSOCIATED_OBJECTS.line_items %}
{% set ADDITIONAL_FEES = ASSOCIATED_OBJECTS.additional_fees %}
{% set TOTALS = ASSOCIATED_OBJECTS.totals || ASSOCIATED_OBJECTS.totals %}
{% set QUOTE_TOTAL = TOTALS.total %}
{% set SUB_TOTALS = TOTALS.subtotals %}
{% set DEAL = ASSOCIATED_OBJECTS.deal %}

What's happening here is we're importing the mock data into the template. We're then setting the QUOTE variable to use the data found in template_data if available. template_data is an object containing all of the data for the quote and deal in the page. If that object is not found in the template, we load the data from the mock data.

We create a few variables from that data to make accessing specific data easier and less verbose.

You do not need to use the variables we provide in our examples, you can structure that data in the way that makes the most sense to you.

Template_data object

The vast majority of the data can be directly accessed through the template_data object. You can use null in your template to see the full object provided. This page breaks down what each property is for.

template data object parameters
VariableTypeDescription
template_data
dict

A dict containing the quote, quote.associaated_objects, and totals dicts.

Quote variables

The information specific to this individual quote.

template data object parameters
VariableTypeDescription
template_data.quote
dict

Dict containing all of the data for the quote itself.

template_data.quote.id
Integer

Deal Id

template_data.quote.hubspot_owner_id
Integer

Deal owner id

template_data.quote.hs_all_owner_ids
integer or array of integers

Deal owner ids

template_data.quote.hs_created_by_user_id
Integer

User that created the quote.

template_data.quote.hs_lastmodifieddate
datetime

Date the quote was last modified. In epoch format.

template_data.quote.hubspot_owner_assigneddate
datetime

Date the quote was assigned an owner. In epoch format.

template_data.quote.hs_createdate
datetime

Date and time the quote was created. In epoch format.

template_data.quote.hs_expiration_date
datetime

Date quote expires. In epoch format.

template_data.quote.hs_title
String

Quote Title

template_data.quote.hs_template_type
String

"CUSTOMIZABLE_QUOTE_TEMPLATE"

template_data.quote.hs_slug
String

URL slug for quote web page.

template_data.quote.hs_proposal_template_path
String

Developer file system path to template. (includes file extension)

template_data.quote.hs_quote_amount
String

Amount of money

template_data.quote.hs_currency
String

Currency the quote amount is in in 3 character ISO 4217 currency code.
"USD"

template_data.quote.hs_language
String

Language code
"en"

template_data.quote.hs_locale
String

Locale code
"en-us"

template_data.quote.hs_terms
String

Terms text provided by quote creator

template_data.quote.hs_sender_firstname
String

First name of the person sending the quote.

template_data.quote.hs_sender_company_name
String

Company name of the person sending the quote

template_data.quote.hs_sender_company_image_url
String

Company logo for the person sending the quote.

template_data.quote.hs_status
String

Status of the quote.
"APPROVAL_NOT_NEEDED"

template_data.quote.hs_primary_color
string/hex color code

"#425b76"

template_data.quote.hs_quote_number
String

Unique quote id number.

template_data.quote.hs_payment_enabled
boolean

Use to test if payment fields need to be shown.

template_data.quote.hs_esign_enabled
boolean

Use to test if esignature fields need to be shown.

Can't find a variable you're looking for?
There are more variables you can access within template_data. Use |pprint to view them. Additionally some variables in quote associations may only be available based on the quote/deal. 

We will be iterating on this documentation to showcase and explain more of the data you have access to. Aside from pretty printing, you can view the mock data file within the cms-quote-theme, to see what is available and the structure it comes in.


Was this page helpful? *
This form is for feedback on our developer docs. If you have feedback on the HubSpot product, please share it in our Idea Forum instead.