# Help with Programmable Email

**URL:** <https://community.hubspot.com/t/help-with-programmable-email/51907>\
**Category:** Email Marketing Tool\
**Tags:** email\
**Created:** [February 21, 2022, 6:18pm UTC](https://community.hubspot.com/t/help-with-programmable-email/51907 "2022-02-21T18:18:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SStrachan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sstrachan/32/99678_2.png) [@SStrachan](https://community.hubspot.com/u/SStrachan)\
**Post date:** [February 21, 2022, 6:18pm UTC](https://community.hubspot.com/t/help-with-programmable-email/51907/1 "2022-02-21T18:18:58Z")

</div>

I am trying to build a workflow to pass a query into a programmable email.

I can pass the query into a landing page, but not the email.

Please watch here for a quick example: [Dropbox Capture](https://capture.dropbox.com/XW54OjzPCGlB2sq6)

Code example:

```lia-code-sample
{% set price_from = request.query_dict.price_from %}
{% set price_to = request.query_dict.price_to %}
<h2> Price From: {{ price_from }}</h2>
<h2> Price To: {{ price_to }}</h2>
<br><br>

{% set yacht = crm_objects("yacht") %}
{% set single_contact = crm_objects("yacht",'limit=600', 'name,yearbuilt,loaft,featuredimagesalesurl,featuredimagesales1url,featuredimagesales2url,featuredimagesales3url,featuredimagesales4url,featuredimagesales5url,featuredimagesales6url,featuredimagesales7url,featuredimagesales8url,price') %}
<!-- {# yacht #} -->
<br>
<br>
<br>
{% for single in single_contact.results %}
 {% if single.price|int >=price_from|int and single.price|int <=price_to|int %}
 <div class="yatch_deatil_section">
 <div class="yatch_img">
 {% if single.featuredimagesalesurl %}
 <img src="{{ single.featuredimagesalesurl }}" style="width:100%">
 {% else %}
 <img src="https://f.hubspotusercontent40.net/hubfs/21272746/not-found.png" style="width:100%">
 {% endif %}
 </div>
 <div class="yatch_info">
 <p><strong>Yatch Name</strong> : {{ single.name }}</p>
 <p><strong>Loaft</strong> : {{ single.loaft }}</p>
 <p><strong>Yearbuilt</strong> : {{ single.yearbuilt }}</p>
 <p><strong>Price</strong> : {{ single.price }}</p>
 </div>

 </div>
 {% endif %}
{% endfor %}
<br>

```

---

<div class="post-metadata">

**Author:** ![MiaSrebrnjak](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/miasrebrnjak/32/10_2.png) [@MiaSrebrnjak](https://community.hubspot.com/u/MiaSrebrnjak)\
**Post date:** [March 3, 2022, 11:57am UTC](https://community.hubspot.com/t/help-with-programmable-email/51907/2 "2022-03-03T11:57:49Z")

</div>

Hi @SStrachan,

Thank you for the video! I’m not familiar with programmable emails, but I found [this Community post](https://community.hubspot.com/t5/Email-Marketing-Tool/Struggling-with-Programmable-Email-Beta-Conditional-Logic/td-p/493724) that might be helpful.

I also wanted to ask @KimM, @Indra, @JBeatty, @lynton for their help & insights - do you maybe know why the custom properties aren’t displayed in the email? Thank you!

Cheers  
Mia, Community Team

---

<div class="post-metadata">

**Author:** ![KimM](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kimm/32/98942_2.png) [@KimM](https://community.hubspot.com/u/KimM)\
**Post date:** [March 4, 2022, 1:33pm UTC](https://community.hubspot.com/t/help-with-programmable-email/51907/3 "2022-03-04T13:33:53Z")

</div>

So I’m still relatively new to the programmable emails stuff, but I think your issue will have to do with the fact that you’re trying to pull a URL query in an email.

It’s not fully clear exactly what you’ve already got set up, but I’m guessing that you want to send an email with results based on a form completion on the site. So you would need to assign the URL query values to a contact property for each or you can query it from a custom object and then pull those properties within the email itself.

The ‘Custom Object’ section of [this article](https://developers.hubspot.com/docs/cms/guides/email/hubdb-crm-objects) might help if you go down that route.

But if you’re assigning the contact properties you could just simply use the contact tokens like so:

```lia-code-sample
{% set price_from = contact.price_from %}
{% set price_to = contact.price_to %}
<h2> Price From: {{ price_from }}</h2>
<h2> Price To: {{ price_to }}</h2>
<br><br>

```

I didn’t dig into the rest of the code as it seems like the main issue was that you couldn’t pull those values in. Once you get that bit right you’ll be able to test the rest of the code.

---

<div class="post-metadata">

**Author:** ![TJensen23](https://avatars.discourse-cdn.com/v4/letter/t/90db22/32.png) [@TJensen23](https://community.hubspot.com/u/TJensen23)\
**Post date:** [April 4, 2022, 3:21am UTC](https://community.hubspot.com/t/help-with-programmable-email/51907/4 "2022-04-04T03:21:31Z")

</div>

yes awesome
