# Contact email in email button link

**URL:** <https://forum.mautic.org/t/contact-email-in-email-button-link/9130>\
**Category:** General Discussion\
**Created:** [August 1, 2017, 3:54am UTC](https://forum.mautic.org/t/contact-email-in-email-button-link/9130 "2017-08-01T03:54:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jan72](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@Jan72](https://forum.mautic.org/u/Jan72)\
**Post date:** [August 1, 2017, 3:54am UTC](https://forum.mautic.org/t/contact-email-in-email-button-link/9130/1 "2017-08-01T03:54:10Z")

</div>

Hello,  
  
I’m trying to build an email with a button. This button should pass the contact email in the url, so I’ve added this link [http://mysite.com/test?email={leadfield=email|true}](http://mysite.com/test?email=%7Bleadfield=email%7Ctrue%7D) to Button Link property and I expected to have the {leadfield=email|true} replaced by contact email but it does not work: how to figure out this issue?  
  
  
  
Thank you

---

<div class="post-metadata">

**Author:** ![Jan72](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@Jan72](https://forum.mautic.org/u/Jan72)\
**Post date:** [August 1, 2017, 3:54am UTC](https://forum.mautic.org/t/contact-email-in-email-button-link/9130/2 "2017-08-01T03:54:10Z")

</div>

Hello,  
I’m trying to build an email with a button. This button should pass the contact email in the url, so I’ve added this link [http://mysite.com/test?email={leadfield=email|true}](http://mysite.com/test?email=%7Bleadfield=email%7Ctrue%7D) to Button Link property and I expected to have the {leadfield=email|true} replaced by contact email but it does not work: how to figure out this issue?

Thank you

---

<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:** [August 1, 2017, 4:58am UTC](https://forum.mautic.org/t/contact-email-in-email-button-link/9130/3 "2017-08-01T04:58:36Z")

</div>

I did something like this and it works. Have you tried to leave out the “true” parameter?

---

<div class="post-metadata">

**Author:** ![Jan72](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@Jan72](https://forum.mautic.org/u/Jan72)\
**Post date:** [August 2, 2017, 3:30am UTC](https://forum.mautic.org/t/contact-email-in-email-button-link/9130/4 "2017-08-02T03:30:50Z")

</div>

Yes I did and it didn’t work. The link I get in the email is always [http://mysite.com/test?email=[Email]](http://mysite.com/test?email=%5BEmail%5D)

---

<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:** [August 2, 2017, 4:54am UTC](https://forum.mautic.org/t/contact-email-in-email-button-link/9130/5 "2017-08-02T04:54:17Z")

</div>

Please try something like this…

```auto
http://mysite.com/test/?unsub=1&email={contactfield=email}
```

…where `unsub=1` is just a dummy parameter you don’t need to evaluate. BTW, how do you evaluate the parameter? Are you putting it to a form on the target page? Or do you use PHP?

---

<div class="post-metadata">

**Author:** ![Jan72](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@Jan72](https://forum.mautic.org/u/Jan72)\
**Post date:** [August 6, 2017, 6:41am UTC](https://forum.mautic.org/t/contact-email-in-email-button-link/9130/6 "2017-08-06T06:41:20Z")

</div>

Hello I tried but it still does not work. I always send me a test email so I tried to send the email using a test campaign without result. I opened the email in browser and I noticed the button link in the email has been transformed to &email={contactfield=email} to &email=[Email]

---

<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:** [August 7, 2017, 12:58pm UTC](https://forum.mautic.org/t/contact-email-in-email-button-link/9130/7 "2017-08-07T12:58:22Z")

</div>

The [Email] thing is correct in the email preview. It should be replaced with the correct value when you send it out however.

---

<div class="post-metadata">

**Author:** ![Jan72](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@Jan72](https://forum.mautic.org/u/Jan72)\
**Post date:** [August 10, 2017, 9:55am UTC](https://forum.mautic.org/t/contact-email-in-email-button-link/9130/8 "2017-08-10T09:55:53Z")

</div>

Ok, I fixed it. I was using the wrong email type, now everything works fine. Anyway I evaluate the params using PHP.

Thank you for your help.

---

<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:** [August 10, 2017, 5:52pm UTC](https://forum.mautic.org/t/contact-email-in-email-button-link/9130/9 "2017-08-10T17:52:31Z")

</div>

@Jan72, what does `wrong email type` mean?

---

<div class="post-metadata">

**Author:** ![tommytx123](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tommytx123/32/833_2.png) [@tommytx123](https://forum.mautic.org/u/tommytx123)\
**Post date:** [September 20, 2017, 6:06pm UTC](https://forum.mautic.org/t/contact-email-in-email-button-link/9130/10 "2017-09-20T18:06:13Z")

</div>

@PeterTL Is that a neat way you have developed to force an unsubscribe using some commands in the test file.  
if so would you be interested in sharing… i love to program new things with mautic… and maybe we could share some new ideas. Thanks

---

<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:** [September 20, 2017, 7:27pm UTC](https://forum.mautic.org/t/contact-email-in-email-button-link/9130/11 "2017-09-20T19:27:13Z")

</div>

@tommytx123:

My unsubscribe mechanism is pretty simple. I provide a personalized email link which redirects the contact to a simple page where he has to input his first name, last name, email and - most important - an optional text field to provide feedback on unsubscribe motive. As the contact should not input his data manually, I am passing parameters to the unsubscribe page. From there, the unsubscribe is handled via form actions.

The `unsub=1` thing is just a workaround. When I first implemented the mechanism, it was not possible to use the email address in the first position of URL parameters (maybe a bug). That’s why I added a dummy parameter. In fact, the URL looks something like `...unsubscribe/?unsub=1&email=...` but the `unsub=1` has no functionality.

---

<div class="post-metadata">

**Author:** ![tommytx123](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/tommytx123/32/833_2.png) [@tommytx123](https://forum.mautic.org/u/tommytx123)\
**Post date:** [September 20, 2017, 7:31pm UTC](https://forum.mautic.org/t/contact-email-in-email-button-link/9130/12 "2017-09-20T19:31:53Z")

</div>

Thanks…@PeterTL I just asked a simple question just now on the forum … i am sure you know the answer… could you look please?  
[https://www.mautic.org/community/index.php/8495-can-we-email-communicate-inside-mautic](https://www.mautic.org/community/index.php/8495-can-we-email-communicate-inside-mautic)
