# Dynamic URL in Email button not working

**URL:** <https://forum.mautic.org/t/dynamic-url-in-email-button-not-working/10235>\
**Category:** Product Support\
**Created:** [February 15, 2018, 4:10am UTC](https://forum.mautic.org/t/dynamic-url-in-email-button-not-working/10235 "2018-02-15T04:10:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bunce69](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bunce69/32/143_2.png) [@bunce69](https://forum.mautic.org/u/bunce69)\
**Post date:** [February 15, 2018, 4:10am UTC](https://forum.mautic.org/t/dynamic-url-in-email-button-not-working/10235/1 "2018-02-15T04:10:02Z")

</div>

Hello guys,

I’m trying to make a dynamic url into some buttons in my emails.

For example :  
href=”[https://domain.com/{contactfield=firstname}”](https://domain.com/%7Bcontactfield=firstname%7D%E2%80%9D) but it doesn’t work.

It works if I do it as a text, but it doesn’t work when I integrate this code in the button.

Any idea?

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [February 15, 2018, 5:19am UTC](https://forum.mautic.org/t/dynamic-url-in-email-button-not-working/10235/2 "2018-02-15T05:19:39Z")

</div>

I tested it and the result is really strange. I built up a link exactly as you did ([http://website.com/{contactfield=firstname}](http://website.com/%7Bcontactfield=firstname%7D)) and sent it to two contacts.

1st contact (called “Firstname (someText)”: The URL was shortened to [http://website.com/](http://website.com/)  
2nd contact (called “Firstname”): The URL was delivered with the name of the 1st contact

This is some bug I guess.

---

<div class="post-metadata">

**Author:** ![bizcrony](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bizcrony/32/409_2.png) [@bizcrony](https://forum.mautic.org/u/bizcrony)\
**Post date:** [February 16, 2018, 2:48am UTC](https://forum.mautic.org/t/dynamic-url-in-email-button-not-working/10235/3 "2018-02-16T02:48:04Z")

</div>

@bunce69 resolved?

---

<div class="post-metadata">

**Author:** ![bunce69](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bunce69/32/143_2.png) [@bunce69](https://forum.mautic.org/u/bunce69)\
**Post date:** [February 16, 2018, 4:37am UTC](https://forum.mautic.org/t/dynamic-url-in-email-button-not-working/10235/4 "2018-02-16T04:37:04Z")

</div>

Yeah mate 😉

Thanks for your help

---

<div class="post-metadata">

**Author:** ![bunce69](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bunce69/32/143_2.png) [@bunce69](https://forum.mautic.org/u/bunce69)\
**Post date:** [February 16, 2018, 5:31am UTC](https://forum.mautic.org/t/dynamic-url-in-email-button-not-working/10235/5 "2018-02-16T05:31:35Z")

</div>

@Peter check with Bizcrony he has the solution

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [February 16, 2018, 9:26am UTC](https://forum.mautic.org/t/dynamic-url-in-email-button-not-working/10235/6 "2018-02-16T09:26:21Z")

</div>

It would be great if the resolution was documented here in the thread. I guess I am not the only one interested in it.

---

<div class="post-metadata">

**Author:** ![bunce69](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bunce69/32/143_2.png) [@bunce69](https://forum.mautic.org/u/bunce69)\
**Post date:** [February 16, 2018, 9:29am UTC](https://forum.mautic.org/t/dynamic-url-in-email-button-not-working/10235/7 "2018-02-16T09:29:21Z")

</div>

Try changing {contactfield=…} to {leadfield=…}

For me it works ^^

---

<div class="post-metadata">

**Author:** ![bizcrony](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bizcrony/32/409_2.png) [@bizcrony](https://forum.mautic.org/u/bizcrony)\
**Post date:** [February 16, 2018, 9:51am UTC](https://forum.mautic.org/t/dynamic-url-in-email-button-not-working/10235/8 "2018-02-16T09:51:33Z")

</div>

Thanks to all

---

<div class="post-metadata">

**Author:** ![borja333](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/borja333/32/333_2.png) [@borja333](https://forum.mautic.org/u/borja333)\
**Post date:** [June 1, 2018, 3:28pm UTC](https://forum.mautic.org/t/dynamic-url-in-email-button-not-working/10235/9 "2018-06-01T15:28:51Z")

</div>

Hello

It does not work for me changing {contactfield = …} to {leadfield = …}  
my version of mautic is v2.12.2  
Could it be because of the coke that the ip does not detect and can not assign the field to it? -\> [https://github.com/mautic/mautic/issues/5345](https://github.com/mautic/mautic/issues/5345)
