# Pre-fetch data from external API in Email Module

**URL:** <https://community.hubspot.com/t/pre-fetch-data-from-external-api-in-email-module/57382>\
**Category:** CMS Development\
**Tags:** javascript, email\
**Created:** [May 20, 2022, 12:31pm UTC](https://community.hubspot.com/t/pre-fetch-data-from-external-api-in-email-module/57382 "2022-05-20T12:31:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmilovanov](https://avatars.discourse-cdn.com/v4/letter/d/8e7dd6/32.png) [@dmilovanov](https://community.hubspot.com/u/dmilovanov)\
**Post date:** [May 20, 2022, 12:31pm UTC](https://community.hubspot.com/t/pre-fetch-data-from-external-api-in-email-module/57382/1 "2022-05-20T12:31:42Z")

</div>

Hi,  
im going to create a special email module for my emailing purposes. In best case this module schould be stand-alone, so i can reuse it in all my email templates without adjusting (adding custom code) my workflows every single time (like Drag and Drop).  
This takes user preferences (list of ids, already saved in user) and schould be able to fetch data from external server responding with “xml” content type and then preprocess it a little bit.  
What is the best approach to fetch data inside a module for email template? As I know, usage of js files as well as \<script\> tag is not supported by email clients.  
Thanks!

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [May 20, 2022, 8:10pm UTC](https://community.hubspot.com/t/pre-fetch-data-from-external-api-in-email-module/57382/2 "2022-05-20T20:10:41Z")

</div>

@Teun what are you thinking? 😀

---

<div class="post-metadata">

**Author:** ![Teun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/teun/32/28739_2.png) [@Teun](https://community.hubspot.com/u/Teun)\
**Post date:** [May 23, 2022, 6:12am UTC](https://community.hubspot.com/t/pre-fetch-data-from-external-api-in-email-module/57382/3 "2022-05-23T06:12:42Z")

</div>

Hi @dmilovanov ,

I tried to build this for a client, but this isn’t really possible without using the Single Send API and custom tokens in your email.  
The best thing you can probably do is store the information in HubSpot instead of retrieving it from an external platform if you want to be able to use the drag and drop emails. Either in a custom object or in contact properties, depending on the usecase.
