CMS Development

ChrisBroeders
Contributeur

Quote Templates and Personalisation Tokens

Hi, so we are currently building out new quote templates with the new beta version that came out. However, I am having some issue in terms of using personalisation tokens in the source code. 

 

I cant seem to find any documentation on this from HubSpot so not sure how to pull the information that I am looking for. 

Basically, quotes are developed from deals and I am looking to pull the deal information into our quote template e.g. Deal: invoice contact, Deal Invoice company, Deal Inoice email etc. 

Using the {{ deal.inovice_contact }} does not work and I assume that I need to pull the information into the template first with something like "{% set DEAL = template_data.quoteAssociatedObjects.deal %}"

Anyone have any idea?


18 Réponses
iancoski
Membre

Quote Templates and Personalisation Tokens

Hi, I'm developing a quote template for our company, cloning the default quote.
I made some adjustments to fixed information and managed to customize with some product tokens in the line_itens_table.
But now I need to put information about a new token created for the business in this same file. That is credit information that this customer has.
When I put it this way: {{ deal.credit_description }} and {{ deal.credit_value }) It doesn't accept and I assume I need to insert some call in the model.

Anyone have any ideas?

0 Votes
tanyaunangst
Participant

Quote Templates and Personalisation Tokens

@jmclaren Have additional fields been added to the template data and is there another way to view that besides pretty printing the template_data?  I checked the Idea thread and didn't see any updates there.   But a Customer Success Manager has informed us that we can access recipient billing address information but I don't see it on the template_data when I pretty print it.  Here is the information that we received.  
Hubspot Billing Address.png

0 Votes
jmclaren
HubSpot Employee
HubSpot Employee

Quote Templates and Personalisation Tokens

Hey there,

Hi @tanyaunangst I believe a game of telephone basically happened causing some context to get lost in that email. I've reached out to the CSM to find out where they were given that information.

I apologize for the confusion this has caused. 

To my knowledge no additional fields have been added to the template data.

As for how you can "view" it and the structure of that data, here is the template_data object with mock data:

 

{
  "hubspotBaseUrl": "https://api.hubapi.com",
  "quote": {
    "id": 1,
    "hubspot_owner_id": "1",
    "hs_all_owner_ids": "1",
    "hs_created_by_user_id": "1",
    "hs_updated_by_user_id": "1",
    "hs_lastmodifieddate": "1/1/20",
    "hubspot_owner_assigneddate": "1/1/20",
    "hs_createdate": "1577898314000",
    "hs_expiration_date": "1609434314000",
    "hs_title": "Sample quote",
    "hs_template_type": "PROPOSAL",
    "hs_proposal_domain": "1.hs-sites.com",
    "hs_proposal_slug": "sampleSlug",
    "hs_proposal_template_path": "cms-proposals-theme/quote__simple.html",
    "hs_quote_amount": "$100",
    "hs_timezone": "US/Eastern",
    "hs_currency": "USD",
    "hs_language": "en",
    "hs_locale": "en-us",
    "hs_public_url_key": "0123456789abcdef",
    "hs_discount_display_style": "Fixed",
    "hs_terms": "<p>Sample terms</p>",
    "hs_comments": "<p>Sample comments</p>",
    "hs_sender_firstname": "Firstname",
    "hs_sender_company_name": "HubSpot",
    "hs_sender_company_image_url": "https://api.hubapiqa.com/avatars/v1/signed-uris/1CmcKFwgEEhNzbGVlcHlzaGVlcC53ZWJzaXRlGJmI4PYFIJyrMyoaYnJhbmRpbmc6YXBpOndlYjp1cy1lYXN0LTEyJjI2MDE6MTg0OjQwODA6NGZjMDpjY2VhOjc2NzA6NGQyMjphZjFhEhkA-NPq9tzonI3OpA087XM8Z2BgzO0mPYq6",
    "hs_status": "APPROVAL_NOT_NEEDED",
    "hs_primary_color": "#425b76",
    "hs_quote_number": "20200101-00000001",
    "hs_payment_enabled": true,
    "hs_esign_enabled": true
  },
  "quoteAssociatedObjects": {
    "company": {
      "id": 1,
      "name": "Sample company",
      "domain": "example.website",
      "city": "San Francisco",
      "state": "California",
      "zip": "90000",
    },
    "contacts": [
      {
        "id": 1,
        "firstname": "First",
        "lastname": "Recipient",
        "email": "firstrecipient@hubspot.com",
        "phone": "12354678981"
      },
      {
        "id": 2,
        "firstname": "Second",
        "lastname": "Recipient",
        "email": "secondrecipient@hubspot.com",
        "phone": "12354678982"
      }
    ],
    "lineItems": [
      {
        "createdate": "1/1/20",
        "hs_position_on_quote": "0",
        "id": 1,
        "name": "First sample line item",
        "description": "About first sample line item",
        "price": "1005",
        "discount": "5",
        "hs_cost_of_goods_sold": "10",
        "hs_margin_tcv": "990",
        "hs_margin_acv": "990",
        "hs_margin": "990",
        "hs_tcv": "1000",
        "hs_acv": "1000",
        "amount": "1000",
        "quantity": "1",
        "hs_line_item_currency_code": "USD",
        "tax": "10",
        "hs_lastmodifieddate": "1/1/20",
        "hs_created_by_user_id": "1",
        "hs_object_id": "1",
        "hs_updated_by_user_id": "1"
      },
      {
        "createdate": "1/1/20",
        "hs_position_on_quote": "1",
        "id": 2,
        "name": "Second sample line item",
        "description": "About second sample line item",
        "price": "105",
        "discount": "5",
        "recurringbillingfrequency": "monthly",
        "hs_cost_of_goods_sold": "10",
        "hs_margin_tcv": "1080",
        "hs_margin_acv": "1080",
        "hs_margin_arr": "1080",
        "hs_margin_mrr": "90",
        "hs_margin": "90",
        "hs_tcv": "1200",
        "hs_acv": "1200",
        "hs_arr": "1200",
        "hs_mrr": "100",
        "amount": "1000",
        "quantity": "1",
        "hs_line_item_currency_code": "USD",
        "tax": "10",
        "hs_lastmodifieddate": "1/1/20",
        "hs_created_by_user_id": "1",
        "hs_object_id": "1",
        "hs_updated_by_user_id": "1"
      }
    ],
    "contactSigners": [
      {
        vid: 1,
        firstName: "First",
        lastName: "Signer",
        email: "firstsigner@hubspot.com",
        avatarUrl:"https://cdn2.hubspotqa.net/hub/99261937/hubfs/d40aadd5-d110-43f0-bf31-fb20ddb2128c.png/height=48/width=48"
      }
    ],
    "userSigners": [],
    "additionalFees": [
      {
        name: "Tax",
        amount: 1000
      },
      {
        name: "Percent Discount",
        amount: 25,
        isPercentage: true,
        category: "DISCOUNT"
      }
    ]
  },
  "totals": {
    "subTotals": {
      "monthly": {
        "subTotal": 100,
        "discountSubTotal": 5
      },
      "one_time": {
        "subTotal": 1000,
        "discountSubTotal": 5
      }
    },
    "total": 1100
  }
}

 

 In there you will see company data.

That data comes from the quote wizard on this step:

Screen Shot 2021-01-25 at 6.17.51 PM.png

 

That data comes out  accessible through template_data.quoteAssociatedObjects.company (or the COMPANY variable that comes in the default version of the tempaltes if you are using that) in this form:

{country=USA, city=Cambridge, num_associated_contacts=0, createdate=1611620216600, hs_num_blockers=0, days_to_close=0, hubspot_owner_id=12456994, first_deal_created_date=1601346743605, recent_deal_amount=500000, hs_created_by_user_id=1234823, num_associated_deals=1, state=Massachussetss, hs_all_owner_ids=12346994, hs_num_open_deals=0, zip=12355, address=1234 Spot Ave, closedate=1611620217326, recent_deal_close_date=1601348448018, hs_user_ids_of_all_owners=1234823, hs_target_account_probability=0.5476861596107483, hs_lastmodifieddate=1611620279289, hs_num_decision_makers=0, hubspot_owner_assigneddate=1611620216600, total_revenue=500000, hs_num_child_companies=0, hs_num_contacts_with_buying_roles=0, hs_object_id=5240393485, name=HubSpot, lifecyclestage=customer, hs_updated_by_user_id=1234823, id=512493485}

 As you can see you can then do: 
COMPANY.country = USA
COMPANY.city= Cambridge
COMPANY.address = 1234 Spot Ave
COMPANY.state = Massachussetss
COMPANY.name= HubSpot
COMPANY.zip = 12355

Note that is not HubSpot's real address, you can tell because there's also an obvious typo.


Jon McLaren

Sr. CMS Developer Advocate

Get started developing on the HubSpot CMS Developer Changelog
How to optimize your CMS Hub site for speed

If my reply answered your question, please mark it as a solution, to make it easier for others to find.

JAubrey
Membre

Quote Templates and Personalisation Tokens

how do I reference the "term" for the line item (like what is used in the Modern standard template)?  i.e., $100 / month for 3 years - whereas "3 years" is the term.  The input screen would have 36 months in the "term" field when creating the line item and the quote shows it as "for 3 years".  Any help would be appreciated. 

0 Votes
jmclaren
HubSpot Employee
HubSpot Employee

Quote Templates and Personalisation Tokens

In your for loop for the line items you can use:

{{ item.hs_term_in_months}}

To access that.

Jon McLaren

Sr. CMS Developer Advocate

Get started developing on the HubSpot CMS Developer Changelog
How to optimize your CMS Hub site for speed

If my reply answered your question, please mark it as a solution, to make it easier for others to find.

tanyaunangst
Participant

Quote Templates and Personalisation Tokens

@jmclaren the template_data|pprint was very helpful.  I'm working with a hubspot user who has added additional fields to the contact information, like billing and shipping addresses.  Will there be a way for me to access that data to be included in the template?  

jmclaren
HubSpot Employee
HubSpot Employee

Quote Templates and Personalisation Tokens

@tanyaunangst Right now there is not a way to access that data in quote templates. Could that change down the road? Potentially but we are going to be very cautious about opening up contact data access in these templates.

 

Quote templates share a lot of the same capabilities and "permissions" as website pages. Website pages have restrictions on what type of contact data can be viewable without a user being signed in, or having to enter a password. This is a security feature to ensure only users who SHOULD have access to an individual contact's data, should have the ability to view it. Quotes are by nature public pages on your website, as long as a user has the address for the quote, they can see it. While in a B2B situation it may be completely fine to display those addresses. If for some reason the person desired that address to be a personal home address they may not appreciate that their name and home address is displaying on a website that you just need the address to view.

As you can understand we take privacy and security very seriously so as we work on this feature we will continue to think through how best to ensure best practices are followed and that quotes can safely display only the necessary information.

 

Hi, I am also working on building a quote template.  I cloned cms-proposals-themes but on the quote template that I am building, there is information that would not be pulled from Hubspot but we would like to have empty fields in the template that the user would fill manually.  Is this functionality possible?  Are you still working on the public documentation for the quote templates?  

Right now only the fields directly in the quote editor and deal are exposed to the template. Quote templates do not support the module functionality of the CMS.

Regarding public documentation - right now we feel the experience could be significantly improved both on the developer and content creator/sales user side. The current implementation while it does make theming and styling quote templates significantly easier, it doesn't appear to be the primary use-case a lot of users have for wanting to use the feature. So at this time we are holding on releasing the developer documentation as things could change to provide a better experience.
Pretty printing the template_data is a great way to view the variables from the quote, companies, and contacts associated to the quote/deal

 

Jon McLaren

Sr. CMS Developer Advocate

Get started developing on the HubSpot CMS Developer Changelog
How to optimize your CMS Hub site for speed

If my reply answered your question, please mark it as a solution, to make it easier for others to find.

BZiegler
Participant

Quote Templates and Personalisation Tokens

Can't you just solve for much of that by adding a level of security in terms of who can view? Seems like the upside would far outweigh the trouble that this situation causes. 

BrucePouchain
Membre

Quote Templates and Personalisation Tokens

Hi, I am also working on building a quote template. 

but I want to duplicate from "Modern" template and not "Simple" template to have a beautiful one 😉

I didn't find it. Can you help please ?

Note : I understand that info deal will be available before the end of the year and that's great. Do you have a schedule date ?

0 Votes
jmclaren
HubSpot Employee
HubSpot Employee

Quote Templates and Personalisation Tokens

but I want to duplicate from "Modern" template and not "Simple" template to have a beautiful one .
Only the Simple and tall templates are available right now to clone from. The other quote templates are not built the same under the hood and can't be cloned from.

 

Note : I understand that info deal will be available before the end of the year and that's great. Do you have a schedule date ?

I'm not sure where you heard that. I can't confirm a timeframe like that. A notification was sent to participants of the beta regarding changes that will be occuring soon which will require some developer work to make existing templates continue to support new features.

We wanted to give ample warning that the data structure will likely have some changes. While it's unfortunate for existing participants of the beta, it will lay a strong foundation for stable version and future iterations.

 


For updates on this feature I would check out the Idea forum post.

Jon McLaren

Sr. CMS Developer Advocate

Get started developing on the HubSpot CMS Developer Changelog
How to optimize your CMS Hub site for speed

If my reply answered your question, please mark it as a solution, to make it easier for others to find.

0 Votes
ChrisBroeders
Contributeur

Quote Templates and Personalisation Tokens

@jmclaren - would you be able to send a link to those changes? I dont think I got anything sent through on that?

 

0 Votes
jmclaren
HubSpot Employee
HubSpot Employee

Quote Templates and Personalisation Tokens

A notification should have came by email notification. We expect that the individual who most needs to know may not be the person on the account who received the notification. So we are communicating through multiple channels.
See the designated answer to this idea post for the announcement:
https://community.hubspot.com/t5/HubSpot-Ideas/Customize-Quote-template-appearance/idi-p/193644
As Ethan notes, there is nothing one needs to do actively at this time, we are purely giving advance warning. We do not have the updated data schema to provide at this time but will let you know when we do.

We will also be publishing this announcement through other means as well to ensure we reach everyone.

That Idea thread is a great place to watch as it will be updated over time as we have announcements related to this feature.

Jon McLaren

Sr. CMS Developer Advocate

Get started developing on the HubSpot CMS Developer Changelog
How to optimize your CMS Hub site for speed

If my reply answered your question, please mark it as a solution, to make it easier for others to find.

0 Votes
tanyaunangst
Participant

Quote Templates and Personalisation Tokens

Hi, I am also working on building a quote template.  I cloned cms-proposals-themes but on the quote template that I am building, there is information that would not be pulled from Hubspot but we would like to have empty fields in the template that the user would fill manually.  Is this functionality possible?  Are you still working on the public documentation for the quote templates?  

rwolupo
Contributeur de premier rang

Quote Templates and Personalisation Tokens

oh @jmclaren this helps very much. thx 🙂

and thank you @dennisedson 

jmclaren
HubSpot Employee
HubSpot Employee

Quote Templates and Personalisation Tokens

Hey there folks, we're still working on readying public documentation.

I think what will be helpful for everyone however is seeing the full data available to you.
If you use pretty print you can see all of the data available to you from the quote and associated deal

{{ template_data|pprint }}

You then use dot notation to access the data.

Some things like contacts should be looped through because you can have multiple contacts associated.

Jon McLaren

Sr. CMS Developer Advocate

Get started developing on the HubSpot CMS Developer Changelog
How to optimize your CMS Hub site for speed

If my reply answered your question, please mark it as a solution, to make it easier for others to find.

rwolupo
Contributeur de premier rang

Quote Templates and Personalisation Tokens

i would love the documentation too 🙂

 

how's that going? 

0 Votes
dennisedson
Équipe de développement de HubSpot
Équipe de développement de HubSpot

Quote Templates and Personalisation Tokens

Heyo @rwolupo , 

Going it is 🙂 

I have notified @jmclaren about this thread and he will post an update as soon as possible!

dennisedson
Équipe de développement de HubSpot
Équipe de développement de HubSpot

Quote Templates and Personalisation Tokens

Hi @ChrisBroeders ,

Apologies for not getting to this question sooner. 

2 points

  1. deal is not available, yet, but may be added later this year.
  2. Documentation is currently being drafted for this as we speak.  I will post back here when I have a link to that!

Thanks for your patience!   Please let us know any other feedback you have!!

 

Best,

Dennis