{"id":1282,"date":"2025-08-28T15:06:17","date_gmt":"2025-08-28T15:06:17","guid":{"rendered":"http:\/\/gogetmuscle.com\/?p=1282"},"modified":"2025-08-28T16:25:06","modified_gmt":"2025-08-28T16:25:06","slug":"programable-email-displaying-associated-deals","status":"publish","type":"post","link":"http:\/\/gogetmuscle.com\/index.php\/2025\/08\/28\/programable-email-displaying-associated-deals\/","title":{"rendered":"Programable Email & Displaying Associated Deals"},"content":{"rendered":"

Hi,\u00a0

(Not a developer, but tasked to develop)

I’m trying to create a programble email module that displays all the associated deals to the recipient that meet a few filter criteria. It doesn’t need to look super nice, but all I need is a table that shows the deal claim number in one column and a hyperlink to a form with some of the fields dyncamically filled in the other column.\u00a0

This is what I have so far, but nothing is rendering in the email tests I send myself. The fallback message is not even displaying. Hoping someone can please tell me what is wrong\/missing, or if this can’t work in email.

In the design manager I’m seeing this warning:\u00a0
Warning: 9:1 DEAL objects can only be retrieved on membership or password-restricted pages

I asked support about this and they ensured it should work in email and my code is the issue.

<\/P>
\n

{% set deal_ids = crm_associations(contact.hs_object_id, “HUBSPOT_DEFINED”, 4) %}<\/P>
\n

{% set matching_deals = [] %}
{% set cutoff_date = 1745020800000 %} {# 2025-04-19 in ms since epoch #}<\/P>
\n

{% for deal_id in deal_ids %}
{% set deal = crm_object(“deal”, deal_id,
“dealname,hubspot_auto_msa_trigger,referral_date,status,dyn365_opportunity_id,claim_number”)
%}<\/P>
\n

{# Ensure referral_date exists and is BEFORE cutoff #}
{% if deal.hubspot_auto_msa_trigger == “Auto-MSA Start”
and deal.status == “Open”
and deal.referral_date and deal.referral_date|int < cutoff_date %}
{% do matching_deals.append(deal) %}
{% endif %}<\/P>
\n

{% if matching_deals|length >= 10 %}
{% break %}
{% endif %}
{% endfor %}<\/P>
\n

{% if matching_deals|length > 0 %}
<\/P><\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
{% for deal in matching_deals %}
<\/p>\n
<\/p>\n
Deal Name<\/th>\n


<\/p>\n

Case Update Link<\/th>\n


<\/tr>\n


<\/thead>\n


<\/p>\n

{{ deal.dealname }}<\/td>\n


<\/p>\n


<a href="https:\/\/hubspotformplaceholder.com\/case-update\/?id=<\/A>{{ deal.dyn365_opportunity_id }}&claim_number={{ deal.claim_number }}” target=”_blank”>
Update Case

<\/td>\n


<\/tr>\n


{% endfor %}
<\/tbody>\n


<\/table>\n


{% else %}
<\/p>\n

No matching deals found.<\/p>\n


{% endif %}<\/p>\n","protected":false},"excerpt":{"rendered":"

Hi,\u00a0(Not a developer, but tasked to develop)I’m trying to create a programble email module that displays all the associated deals to the recipient that meet a few filter criteria. It doesn’t need to look super nice, but all I need is a table that shows the deal claim number in one column and a hyperlink […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"tags":[],"_links":{"self":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts\/1282"}],"collection":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/comments?post=1282"}],"version-history":[{"count":1,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts\/1282\/revisions"}],"predecessor-version":[{"id":1283,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts\/1282\/revisions\/1283"}],"wp:attachment":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/media?parent=1282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/categories?post=1282"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/tags?post=1282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}