Skip to content

Instantly share code, notes, and snippets.

@anka
Created February 16, 2023 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anka/dc32498a0e7837451d7274595f6272b6 to your computer and use it in GitHub Desktop.
Save anka/dc32498a0e7837451d7274595f6272b6 to your computer and use it in GitHub Desktop.
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;">
<tr>
<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>
</tr>
<!-- 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 %}
<tr>
<!-- 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%;">{{line_item.name}}</td>
<td style="width:20%;text-align:right;white-space:nowrap;">{{line_item.price}}</td>
</tr>
{% endfor %}
</table>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment