Pulling in Deal Line items for automated emails

Hello @SFurlong

to pull line items from a deal in a HubSpot email using the code you provided.

you can combine the deal URL and line item details in a HubSpot email:

<p>Deal URL: <a href="{{ deal.url }}/{{ deal.order_id }}">{{ deal.url }}/{{ deal.order_id }}</a></p>

<p>Line items:</p>
<ul>
{% for line_item in deal.line_items %}
 <li>{{ line_item.name }} - {{ line_item.price }}</li>
{% endfor %}
</ul>

the deal.url and deal.order_id variables are used to create a link to the deal page. The deal.line_items loop is used to display a list of line items, including their name and price.

If you’re not seeing any errors in the email editor and the code is not displaying any output, it’s possible that the deal you’re testing with doesn’t have any line items. You may need to create a new deal with line items to test the email.

It’s also possible that the issue is related to the “send preview” feature. The preview may not show the updated email content if the email is triggered by an automation or workflow. To test the email with live data, you can create a test deal with line items and trigger the email manually.