Skip to content

Instantly share code, notes, and snippets.

Created February 16, 2023 19:25
What would you like to do?
Display line items data within an automated Hubspot e-mail template
<div class="data-container">
<div class="data-title">Details of your order</div>
<div class="data">
<table style="width:100%;font-size:.8rem;">
<th style="width:2%;">Pos</th>
<th style="width:2%;">Qty</th>
<th style="width:70%;">Name</th>
<th style="width:20%;text-align:right;">Price</th>
<!-- Get all line items from the deal sorted like in the deal UI -->
{% set items = crm_associations(deal.hs_object_id, "HUBSPOT_DEFINED", 19, "limit=100&orderBy=hs_position_on_quote", "name,price,quantity,hs_position_on_quote", true)%}
{% for line_item in items.results %}
<!-- Use loop.index for a 1-based index -->
<td style="width:2%;">{{loop.index}}</td>
<td style="width:2%;">{{line_item.quantity}}</td>
<td style="width:10%;">{{}}</td>
<td style="width:20%;text-align:right;white-space:nowrap;">{{line_item.price}}</td>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment