# Custom code in workflow - To send email to a certain contact.

**URL:** <https://community.hubspot.com/t/custom-code-in-workflow-to-send-email-to-a-certain-contact/49476>\
**Category:** Data Hub\
**Created:** [January 10, 2022, 11:30am UTC](https://community.hubspot.com/t/custom-code-in-workflow-to-send-email-to-a-certain-contact/49476 "2022-01-10T11:30:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisChiha](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/chrischiha/32/90510_2.png) [@ChrisChiha](https://community.hubspot.com/u/ChrisChiha)\
**Post date:** [January 10, 2022, 11:30am UTC](https://community.hubspot.com/t/custom-code-in-workflow-to-send-email-to-a-certain-contact/49476/1 "2022-01-10T11:30:22Z")

</div>

Hello,

I am currently looking to use custom code in my workflows to send an email to a certain contact in my deal.

Noting:

- I have multiple contact types inside a deal

- I am using deal-based worfklows as i have deal based personalization tokens in my email contents.

- Association labels are not feasable for me in the meantime.

So i want to use custom code to trigger an email to a certain contact in a deal.

Let’s say i have a customer and a sales person inside a deal. I want to send an email to the customer in that deal when the deal meets certain criteria. Only the customer. (Maybe trigger an API to send emai through custom code ?)

This is crucial for me to solve, i would really appreciate your support here.

Thanks !

Chris

---

<div class="post-metadata">

**Author:** ![JenWeiss](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jenweiss/32/93582_2.png) [@JenWeiss](https://community.hubspot.com/u/JenWeiss)\
**Post date:** [January 11, 2022, 7:25pm UTC](https://community.hubspot.com/t/custom-code-in-workflow-to-send-email-to-a-certain-contact/49476/2 "2022-01-11T19:25:36Z")

</div>

Hi @ChrisChiha,

Thank you so much for reaching out to us!

I wanted to go ahead and tag some of our experts into this @Josh , [@Phil\_Vallender](https://community.hubspot.com/t5/user/viewprofilepage/user-id/74) , and @rikkilear .

Best,

@JenWeiss

---

<div class="post-metadata">

**Author:** ![CZamp](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/czamp/32/99730_2.png) [@CZamp](https://community.hubspot.com/u/CZamp)\
**Post date:** [March 24, 2022, 12:28pm UTC](https://community.hubspot.com/t/custom-code-in-workflow-to-send-email-to-a-certain-contact/49476/3 "2022-03-24T12:28:20Z")

</div>

Hi @JenWeiss , @Josh , [@Phil\_Vallender](https://community.hubspot.com/t5/user/viewprofilepage/user-id/74) , and @rikkilear .  
I am also very interested in the topic. Might you have any news/suggestions about it?

---

<div class="post-metadata">

**Author:** ![ChrisChiha](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/chrischiha/32/90510_2.png) [@ChrisChiha](https://community.hubspot.com/u/ChrisChiha)\
**Post date:** [March 24, 2022, 12:31pm UTC](https://community.hubspot.com/t/custom-code-in-workflow-to-send-email-to-a-certain-contact/49476/4 "2022-03-24T12:31:13Z")

</div>

Hello @CZamp ,

As long as you want to use deal properties/tokens in your communications body, you have to use Deal based workflow + Association labels. Thats the only way unfortunately.

---

<div class="post-metadata">

**Author:** ![CZamp](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/czamp/32/99730_2.png) [@CZamp](https://community.hubspot.com/u/CZamp)\
**Post date:** [March 24, 2022, 12:44pm UTC](https://community.hubspot.com/t/custom-code-in-workflow-to-send-email-to-a-certain-contact/49476/5 "2022-03-24T12:44:03Z")

</div>

Thanks Chris. I will ask to get the Beta version so that I can try and use the Association labels too. 🙂

---

<div class="post-metadata">

**Author:** ![maulanariziq](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@maulanariziq](https://community.hubspot.com/u/maulanariziq)\
**Post date:** [March 28, 2022, 2:45am UTC](https://community.hubspot.com/t/custom-code-in-workflow-to-send-email-to-a-certain-contact/49476/6 "2022-03-28T02:45:33Z")

</div>

I am interested in the topic. I would like to send email notification based on field “admin\_email” on my custom object. Is it possible to implement it using custom code workflow in hubspot and how to do it? Thank you.
