# Coding an email module - Getting custom properties from lineitems into email

**URL:** <https://community.hubspot.com/t/coding-an-email-module-getting-custom-properties-from-lineitems-into-email/84098>\
**Category:** APIs & Integrations\
**Tags:** email\
**Created:** [June 26, 2023, 1:07pm UTC](https://community.hubspot.com/t/coding-an-email-module-getting-custom-properties-from-lineitems-into-email/84098 "2023-06-26T13:07:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![IOspect](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/iospect/32/84335_2.png) [@IOspect](https://community.hubspot.com/u/IOspect)\
**Post date:** [June 26, 2023, 1:07pm UTC](https://community.hubspot.com/t/coding-an-email-module-getting-custom-properties-from-lineitems-into-email/84098/1 "2023-06-26T13:07:48Z")

</div>

Hi there,

I am trying to create an email module where lineitems will be listed according to the associated deal.

Every lineitem needs to include 5 properties(same everytime), whereas 3 of them is custom. After this, it ends with a line(--------), and the next lineitem(with props) will be listed. etc, etc

My problem is to get the custom properties inserted into the email.

When i preview it, it just doesnt show anything where they should be.

Any suggestions to this? 🙂

It all seems pretty standard, but i cant seem to find the problem here.

 ![IOspect_0-1687784154003.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/8/5/85b8af272e4adc41b500ee080bfdd1497c06d862.png)

Email-module mockup:

 ![IOspect_2-1687784356170.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/0/1/012a6797247252c7825b1f7beeb2718e2bffe4e3.png)

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [June 27, 2023, 6:08pm UTC](https://community.hubspot.com/t/coding-an-email-module-getting-custom-properties-from-lineitems-into-email/84098/2 "2023-06-27T18:08:05Z")

</div>

Hi, @IOspect

Quick request, can you please share your code example as a reply? You can use the code block formatter to keep things neat.

 ![CleanShot 2023-06-27 at 12.01.22.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/3/6/36d2c88ee90f255312517dd2db4841b3473474d7.png)

Troubleshooting from a code example is always easier for our community members. You didn’t do anything wrong, my goal is to increase the odds of you getting a helpful reply.

Thank you! — Jaycee

---

<div class="post-metadata">

**Author:** ![IOspect](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/iospect/32/84335_2.png) [@IOspect](https://community.hubspot.com/u/IOspect)\
**Post date:** [June 28, 2023, 5:20am UTC](https://community.hubspot.com/t/coding-an-email-module-getting-custom-properties-from-lineitems-into-email/84098/3 "2023-06-28T05:20:06Z")

</div>

```lia-code-sample
{#//module.html#}
<br>
<br>
<span style="font-family: Arial; font-size: 15px;">

{% email_each list="deal.line_items" item="line_item" %}
<ul>
<li>Produkt: {{ personalization_token('line_item.name', 'name') }}</li>
<li>Kampagne start: {{ personalization_token('line_item.Kampagne_start','') }}</li>
<li>Kampagne **bleep** : {{ personalization_token('line_item.Kampagne_slut', '') }}</li>
<li>Visninger: {{ personalization_token('line_item.Visninger_lineitem', 'Ikke relevant') }}</li>
<li>Vilkår: {{ personalization_token('line_item.Description', '') }}</li>
<li>Note: {{ personalization_token('line_item.Note_til_produkt', '') }}</li>
</ul>
{% endemail_each %}
<br>

```

---

<div class="post-metadata">

**Author:** ![IOspect](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/iospect/32/84335_2.png) [@IOspect](https://community.hubspot.com/u/IOspect)\
**Post date:** [June 28, 2023, 5:22am UTC](https://community.hubspot.com/t/coding-an-email-module-getting-custom-properties-from-lineitems-into-email/84098/4 "2023-06-28T05:22:59Z")

</div>

Hi Jaycee,

Thanks for the advice, i see that it makes it better 🙂

UPDATE:

I solved this by publishing it and testing it through a workflow.

The issue was that the “review” when making the email cant work with product properties. So to test the code and solution, i needed to run it live.

That is definetly something i will write down to remember 😉
