# Using merge fields for dynamic content in emails

**URL:** <https://community.hubspot.com/t/using-merge-fields-for-dynamic-content-in-emails/85959>\
**Category:** Email Marketing Tool\
**Tags:** professional\
**Created:** [July 24, 2023, 11:47am UTC](https://community.hubspot.com/t/using-merge-fields-for-dynamic-content-in-emails/85959 "2023-07-24T11:47:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TWheeler0](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@TWheeler0](https://community.hubspot.com/u/TWheeler0)\
**Post date:** [July 24, 2023, 11:47am UTC](https://community.hubspot.com/t/using-merge-fields-for-dynamic-content-in-emails/85959/1 "2023-07-24T11:47:42Z")

</div>

Is there a way to use merge fields to create dynamic content in emails?

For context: I have a website that has forms to download content but I dont want to create 100s of forms for each download - is there a way to have one form and then have dynamic content (merge fields) for the these files to be sent via email.

In pardot - I had the form URL, with the {{name\_of\_download}} and {{url\_of\_download}} and in the email that was sent to the user it would pull the correct file, but it was one universal form.

I really hope this makes sense - been searching all day for this but can’t find an answer

---

<div class="post-metadata">

**Author:** ![TomM2](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tomm2/32/70887_2.png) [@TomM2](https://community.hubspot.com/u/TomM2)\
**Post date:** [July 24, 2023, 12:33pm UTC](https://community.hubspot.com/t/using-merge-fields-for-dynamic-content-in-emails/85959/2 "2023-07-24T12:33:24Z")

</div>

Hey @TWheeler0 merge tags are just called “personalization tokens” within HubSpot and can be used quite easily in emails! As long as the information is within a property you can use them. There’s a [great article on these here](https://knowledge.hubspot.com/website-pages/personalize-your-content).

---

<div class="post-metadata">

**Author:** ![TWheeler0](https://avatars.discourse-cdn.com/v4/letter/t/b5e925/32.png) [@TWheeler0](https://community.hubspot.com/u/TWheeler0)\
**Post date:** [July 24, 2023, 2:32pm UTC](https://community.hubspot.com/t/using-merge-fields-for-dynamic-content-in-emails/85959/3 "2023-07-24T14:32:11Z")

</div>

Hey @TomM2 , sorry if I am not getting it - but if I wanted to add the file to an email - where would I add these properties.

For an example this is an exisiting form with the merge fields

[https://info.bradfordjacobs.com/l/540262/2022-09-06/3v5gn1k?\*\*Name\_of\_Latest\_Download=Saudi%20Arabia%20EOR%20Guide\*\*&\*\*URL\_of\_Latest\_Download=Saudi-Arabia-Country-Guide](https://info.bradfordjacobs.com/l/540262/2022-09-06/3v5gn1k? **Name%5C_of%5C_Latest%5C_Download=Saudi%20Arabia%20EOR%20Guide** &**URL%5C_of%5C_Latest%5C_Download=Saudi-Arabia-Country-Guide)\*\*

These merge fields would then be pulled into the email - so I am wondering how I would add this to my form as well as the email!

I think I have just confused the issue!

---

<div class="post-metadata">

**Author:** ![TomM2](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tomm2/32/70887_2.png) [@TomM2](https://community.hubspot.com/u/TomM2)\
**Post date:** [July 24, 2023, 8:11pm UTC](https://community.hubspot.com/t/using-merge-fields-for-dynamic-content-in-emails/85959/4 "2023-07-24T20:11:58Z")

</div>

Hey @TWheeler0 any fields should be created as a property within HubSpot and added to your form, if you don’t want them displayed on the form, you can add them as a hidden field and populate them via a query string as you have in the url provided.

> **[Pass contact property values with hidden form fields](https://knowledge.hubspot.com/forms/pass-contact-property-values-with-hidden-form-fields)**
>
> Learn how to use hidden form fields to pass values into contact properties on a contact record without requiring the contact to fill in that information on the form.

> **[Auto-populate form fields with a query string](https://knowledge.hubspot.com/forms/can-i-auto-populate-form-fields-through-a-query-string)**
>
> Learn how to auto-populate field values in a form on a page by adding query strings to the page URL.

Once the fields are submit on the form, the contact will have them as a contact property value. Which you can just insert as a personalization token in any email (see the link on my initial comment).

---

<div class="post-metadata">

**Author:** ![BSingh36](https://avatars.discourse-cdn.com/v4/letter/b/3bc359/32.png) [@BSingh36](https://community.hubspot.com/u/BSingh36)\
**Post date:** [May 4, 2026, 11:56am UTC](https://community.hubspot.com/t/using-merge-fields-for-dynamic-content-in-emails/85959/5 "2026-05-04T11:56:46Z")

</div>

What’s happening in your example  
That URL you shared is passing values into the form via query parameters:

?Name\_of\_Latest\_Download=Saudi%20Arabia%20EOR%20Guide  
&URL\_of\_Latest\_Download=Saudi-Arabia-Country-Guide  
Those parameters populate hidden form fields (or mapped fields) when the page loads.  
Step 1 — Add fields to your form  
In your form builder (likely Pardot/Account Engagement, HubSpot, etc.):  
Create custom fields:  
Name\_of\_Latest\_Download  
URL\_of\_Latest\_Download  
Add them to your form as:  
Hidden fields (typical for this use case), OR  
Visible if you actually want users to see/edit them  
Configure them to accept URL parameters  
(often called “query string mapping” or “prefill from URL”)  
Step 2 — Pass values via the link  
When someone lands on the form page, you append parameters like:

?Name\_of\_Latest\_Download=Your%20File%20Name  
&URL\_of\_Latest\_Download=[yourfilelink.com](https://yourfilelink.com/file.pdf)  
That’s what auto-fills those fields behind the scenes.  
Step 3 — Use the fields in your email  
Now comes the payoff.  
Inside your email template, you insert merge tags like:  
{{Name\_of\_Latest\_Download}}  
{{URL\_of\_Latest\_Download}}  
(Exact syntax depends on your platform—Pardot uses %%field\_name%%, HubSpot uses {{ contact.field\_name }}, etc.)  
Example:  
Download your guide here: {{URL\_of\_Latest\_Download}}  
The key idea (this is the part that trips people up)  
You do not attach the file directly in the form.  
Instead:  
The form captures/stores the link + name  
The email pulls that data and displays it  
Think of it like a relay race:  
URL → Form fields → Email merge tags  
Common gotchas  
Field API names must match exactly (case-sensitive in some systems)  
URL encoding matters (%20 for spaces, etc.)  
Hidden fields won’t work unless explicitly set to accept query params  
Emails won’t show anything if the field is empty
