# Issue using user-mail with hyphen in linkto tag

**URL:** <https://community.silverfin.com/t/issue-using-user-mail-with-hyphen-in-linkto-tag/1969>\
**Category:** Templates\
**Created:** [December 7, 2020, 1:44pm UTC](https://community.silverfin.com/t/issue-using-user-mail-with-hyphen-in-linkto-tag/1969 "2020-12-07T13:44:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gianluca](https://avatars.discourse-cdn.com/v4/letter/g/82dd89/32.png) [@Gianluca](https://community.silverfin.com/u/Gianluca)\
**Post date:** [December 7, 2020, 1:44pm UTC](https://community.silverfin.com/t/issue-using-user-mail-with-hyphen-in-linkto-tag/1969/1 "2020-12-07T13:44:12Z")

</div>

Hi,

We are facing some issues with URLs that are generated within a capture tag using user e-mail addresses having a hyphen in it.

This is a code example of what we want to achieve:  
User e-mail: {{ user.email }}  
User name: {{ user.name }}

```
{% capture linkToUploadProxy %}http://xxxxx.ey.net:9999/export/corporatetax/pdf?useremail={{ user.email }}{% endcapture %}

{{ linkToUploadProxy }} <br>

{% linkto linkToUploadProxy target:"_blank" %}Link{% endlinkto %}

```

When the user has an e-mail address without hyphen everything works fine. However, when the user has a hyphen in their e-mail address, we get following liquid error:

> Liquid error: URI must be ascii only"[http://xxxxx.ey.net:9999/export/corporatetax/pdf?useremail=name.surname1](http://xxxxx.ey.net:9999/export/corporatetax/pdf?useremail=name.surname1) **\u2010** [surname2@be.ey.com](mailto:surname2@be.ey.com)" in code: linkto linkToUploadProxy target:“\_blank”

We can see the hyphen is translated into **\u2010**. However, when I display the capture tag, that issue does not appear there. It is only within the linkto tag.

Please also find hereunder a screenshot showing our issue:

 ![dd](https://canada1.discourse-cdn.com/flex030/uploads/getsilverfin/original/2X/4/4af819d0ebf56e87d8fc384f4a2fd1a1bcb1d342.jpeg)

Is this a bug or do you have a workaround?

Thanks in advance.

Kind regards,  
Gianluca

---

<div class="post-metadata">

**Author:** ![agustin](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/agustin/32/1207_2.png) [@agustin](https://community.silverfin.com/u/agustin)\
**Post date:** [December 7, 2020, 3:05pm UTC](https://community.silverfin.com/t/issue-using-user-mail-with-hyphen-in-linkto-tag/1969/2 "2020-12-07T15:05:38Z")

</div>

Hi Gianluca,

You could use the filter “url\_encode” which will handle all this potential issues and generate a safe string to be used as a link.

So, implemented in your code would look like this:

```
{% capture linkToUploadProxy %}http://xxxxx.ey.net:9999/export/corporatetax/pdf?useremail={{ user.email | url_encode }}{% endcapture %}

{{ linkToUploadProxy }} <br>

{% linkto linkToUploadProxy target:"_blank" %}Link{% endlinkto %}

```

I hope this solves your issue.  
Kind regards,  
Agustín

---

<div class="post-metadata">

**Author:** ![Gianluca](https://avatars.discourse-cdn.com/v4/letter/g/82dd89/32.png) [@Gianluca](https://community.silverfin.com/u/Gianluca)\
**Post date:** [December 7, 2020, 3:51pm UTC](https://community.silverfin.com/t/issue-using-user-mail-with-hyphen-in-linkto-tag/1969/3 "2020-12-07T15:51:21Z")

</div>

Hi Agustin,

Thanks for your quick reply. This fixed it!

Kind regards,  
Gianluca
