# Putting a dynamic link in an Infusionsoft email as href

**URL:** <https://integration.keap.com/t/putting-a-dynamic-link-in-an-infusionsoft-email-as-href/8362>\
**Category:** API Q&A\
**Created:** [August 2, 2017, 3:49pm UTC](https://integration.keap.com/t/putting-a-dynamic-link-in-an-infusionsoft-email-as-href/8362 "2017-08-02T15:49:13Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bonnie\_Kasperek](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@Bonnie\_Kasperek](https://integration.keap.com/u/Bonnie_Kasperek)\
**Post date:** [August 2, 2017, 3:49pm UTC](https://integration.keap.com/t/putting-a-dynamic-link-in-an-infusionsoft-email-as-href/8362/1 "2017-08-02T15:49:13Z")

</div>

I am a developer attempting to provide a personalized link for each email we send out. We have methods to replace variables in the text with fields provided by our system. Unfortunately, the link can only be displayed as the literal text (which looks like crap with a bunch of encrypted post variables). I was hoping there was some way to embed links in the literal text passed to infusionsoft rather than using the GUI which only allows a generic link in the email not a custom one for each email. Basically, I can get the link on the email text but it would look a lot better as a button or linked text. Please let me know if any of you have had a similar problem.

---

<div class="post-metadata">

**Author:** ![John\_Borelli](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/john_borelli/32/11880_2.png) [@John\_Borelli](https://integration.keap.com/u/John_Borelli)\
**Post date:** [August 2, 2017, 5:04pm UTC](https://integration.keap.com/t/putting-a-dynamic-link-in-an-infusionsoft-email-as-href/8362/2 "2017-08-02T17:04:36Z")

</div>

You can place a button with a url that uses merge codes for parameters.

---

<div class="post-metadata">

**Author:** ![Bonnie\_Kasperek](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@Bonnie\_Kasperek](https://integration.keap.com/u/Bonnie_Kasperek)\
**Post date:** [August 2, 2017, 9:03pm UTC](https://integration.keap.com/t/putting-a-dynamic-link-in-an-infusionsoft-email-as-href/8362/3 "2017-08-02T21:03:34Z")

</div>

I have tried this and though the button shows up, the link seems to get wiped out. Does infusionsoft remove any onclick from button definitions? that is what it appears like when I inspect it. I have a linked text now but button would be ideal.

---

<div class="post-metadata">

**Author:** ![John\_Borelli](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/john_borelli/32/11880_2.png) [@John\_Borelli](https://integration.keap.com/u/John_Borelli)\
**Post date:** [August 2, 2017, 9:18pm UTC](https://integration.keap.com/t/putting-a-dynamic-link-in-an-infusionsoft-email-as-href/8362/4 "2017-08-02T21:18:42Z")

</div>

So maybe we need to be more specific about what you’re working with?

Are you editing an email in html instead of the builder? If using the builder, which one are you using (new or old)?

---

<div class="post-metadata">

**Author:** ![Bonnie\_Kasperek](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@Bonnie\_Kasperek](https://integration.keap.com/u/Bonnie_Kasperek)\
**Post date:** [August 2, 2017, 9:27pm UTC](https://integration.keap.com/t/putting-a-dynamic-link-in-an-infusionsoft-email-as-href/8362/5 "2017-08-02T21:27:40Z")

</div>

![UrlSwap](https://us1.discourse-cdn.com/flex019/uploads/infusionsoft1/original/2X/c/c0b50b7a2120e3b62828569f2873bdb7bfae57b4.PNG)

So we have code that str\_Replaces the HTML and plaintext from the template and returns the template with substituted values. as you can see right now I swap an \<a href=“Link”\> for the link area. but but \<button onclick=URL\> the whole onlick=URL get removed. It wont replace the variable in the URL area of the template builder so ive been trying to pass whole HTML objects including the link.

---

<div class="post-metadata">

**Author:** ![Bonnie\_Kasperek](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@Bonnie\_Kasperek](https://integration.keap.com/u/Bonnie_Kasperek)\
**Post date:** [August 2, 2017, 9:28pm UTC](https://integration.keap.com/t/putting-a-dynamic-link-in-an-infusionsoft-email-as-href/8362/6 "2017-08-02T21:28:37Z")

</div>

![emailTemplate](https://us1.discourse-cdn.com/flex019/uploads/infusionsoft1/original/2X/0/0e0de459996ccc96cbd7eee191de567ea768b2ba.PNG)  
and here is the email with fields to replace

---

<div class="post-metadata">

**Author:** ![John\_Borelli](https://sea1.discourse-cdn.com/flex019/user_avatar/integration.keap.com/john_borelli/32/11880_2.png) [@John\_Borelli](https://integration.keap.com/u/John_Borelli)\
**Post date:** [August 2, 2017, 9:39pm UTC](https://integration.keap.com/t/putting-a-dynamic-link-in-an-infusionsoft-email-as-href/8362/7 "2017-08-02T21:39:22Z")

</div>

So if this is an email from within Infusionsoft (you’re using the old builder btw) then why replace what merge fields can do automatically for you? The button I was referencing would have been through the new builder which is why this is so different. Next question is, what you have pictured here… is the an actual email or just a template?

---

<div class="post-metadata">

**Author:** ![Bonnie\_Kasperek](https://avatars.discourse-cdn.com/v4/letter/b/e8c25b/32.png) [@Bonnie\_Kasperek](https://integration.keap.com/u/Bonnie_Kasperek)\
**Post date:** [August 2, 2017, 9:46pm UTC](https://integration.keap.com/t/putting-a-dynamic-link-in-an-infusionsoft-email-as-href/8362/8 "2017-08-02T21:46:35Z")

</div>

![SwapEmail](https://us1.discourse-cdn.com/flex019/uploads/infusionsoft1/original/2X/2/20e8220284325386edb2a6e919b2772aab8bf899.PNG)  
That was just the template to demonstrate where the fields are that the substitution array swaps. Here is the best I have so far. Honestly I think I might just format the link to look like a button. it seems a bit like cheating but whatever works. Thank you for your help and patience!

---

<div class="post-metadata">

**Author:** ![Caleb\_Konwinski](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@Caleb\_Konwinski](https://integration.keap.com/u/Caleb_Konwinski)\
**Post date:** [March 23, 2018, 5:44pm UTC](https://integration.keap.com/t/putting-a-dynamic-link-in-an-infusionsoft-email-as-href/8362/9 "2018-03-23T17:44:18Z")

</div>

Hello,

How would you go about placing a button with a url that uses merge codes for parameters?

I have created my own Double Opt-In email using HTML. I created an image of a button that says “Confirm my Subscription”. I would like that button to appear instead of just a text link.

The first thing I tried was to embed the merge code (~OptIn\_14~) into an attribute before the image source, but that didn’t work.

 

I then tried creating an Automation link in IS. In the HTML section of my custom Confirmation Link, I added in the source of my image and saved. But the opt in hyperlink shows up after the image.

 

Do you know of a way I can have an image (such as my button) serve a hyperlink with an InfusionSoft Merge Code embedded?

---

<div class="post-metadata">

**Author:** ![Tina\_Lei](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@Tina\_Lei](https://integration.keap.com/u/Tina_Lei)\
**Post date:** [October 9, 2018, 3:49am UTC](https://integration.keap.com/t/putting-a-dynamic-link-in-an-infusionsoft-email-as-href/8362/10 "2018-10-09T03:49:15Z")

</div>

I have the same issue, no merge filed available on a button or image. Did you figure out finally? I don’t want to use a html template.
