APIs & Integrations

MarkdeLange
Top Contributor | Partner
Top Contributor | Partner

Script {{contact.email}}

We use this script to pull information from the users into the link URL. For example https://domain.com/xxx?login={{contact.email}}. The URL which was created was https://domain.com/xxx?login=name@domain.com. The link has now changed to https://domain.com/xxx?login=name%40domain.com where the “@” sign has changed to the html equivalent of “%40”.
We have added some code to deal with this where we control the web site, but we use this also for 3rd party web sites. It will help if hubspot can revert the URL back to “@” when using the script {{contact.email}} rather than the html equivalent of “%40”, else these links will not work.
Mark de Lange

0 Upvotes
5 Replies 5
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Script {{contact.email}}

Hi @markdelange,

It looks like the email is being URL encoded during the link wrapping process for email click tracking, not when the HubL token is actually evaluated. The @ symbol is an RFC reserved character, so it has to be percent-encoded when we produce the URI as a part of the link tracking. This is the proper way to handle @ symbols in URIs, so it's not something we're planning on changing. I'd recommend updating your script(s) to handle the %40-to-@ translation.

https://tools.ietf.org/html/rfc3986#section-2.2

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Script {{contact.email}}

Hi @markdelange,

Just to make sure that we're on the same page, this token is inside the href attribute of an image? Can you send me a link to the email in HubSpot so that I can take a closer look?

0 Upvotes
MarkdeLange
Top Contributor | Partner
Top Contributor | Partner

Script {{contact.email}}

Hi Derek,

OOPs I did not get message before. Here is a link to an email https://app.hubspot.com/email/3924714/details/5555112026/performance. The script we use to pull the email address is https://domain.com?login={{contact.email}}. Untill recently the email would output as XXX@xxx.com now it outputs as XXX%40xxx.com . We use this script also to populuate forms in other platforms.
Regards,
Mark

0 Upvotes
danaketh
Participant

Script {{contact.email}}

You can try {{ contact.email|replace('%40', '@') }} or {{ contact.email|safe }}. Considering you haven’t really explained where does this happen and how does your script look like, I can’t help you more as I can’t test it in our environment.

0 Upvotes
MarkdeLange
Top Contributor | Partner
Top Contributor | Partner

Script {{contact.email}}

Thanks Daniel,
The link is used in an email and hyperlined with an image, a bit like a call to action.
Neither of your suggestions changed tghe “%40” with a “@”.
Regards,
Mark

0 Upvotes