CMS Development

matthaltom
Participante

URL Encoding issue on custom url with email.

Hi there.
We are attempting to send an email through hubspot that allows the user to confirm their email in OUR platform we developed.

 

We created a contact property we populate with the custom URL and insert that into an email via a personlization token. We then automatically send that email to the user when we see it is populated.


The issue we are running into is that the URL encoding of that link once is has been sent to the user breaks. The email pulled from the contact would look like this, `test+1@gmail.com`. The encoded email in the URL appears as `test%201%40gmail.com`. That `+` character should be encoded as `%2B`. Is there something wrong we are missing?

The closest forum help I've found is https://integrate.hubspot.com/t/script-contact-email/8390

9 Respuestas 9
Clément_Abadie
Participante

URL Encoding issue on custom url with email.

Nope 🙁

0 Me gusta
THandzlik
Miembro

URL Encoding issue on custom url with email.

Hi, I'm facing the same issue. Any update on this?

itsvla
Participante

URL Encoding issue on custom url with email.

Currently facing the same issue with our custom URL.  Any update on this bugfix?

dennisedson
Equipo de producto de HubSpot
Equipo de producto de HubSpot

URL Encoding issue on custom url with email.

hey @itsvla,  I am not seeing anything related to fixing the encoding issue here, but I am still looking.  I will update this thread if I find something of use.

 

Thanks!

 

dennisedson
Equipo de producto de HubSpot
Equipo de producto de HubSpot

URL Encoding issue on custom url with email.

Heya all!

Just an update here on the reason there has not been a fix for this specific issue.  

 

The reason is that there is no way for us to know when creating URLs that we should be encoding the *+* versus treating it like a space. If we were to attempt to maintain *+* signs in all URLs, there is a chance that we may introduce unintended bugs with URLs that rely on it being treated as a space.  

 

With that being said, we have explored this several times. If there is a solution, I will make sure to add to this post.

 

Thanks,

SuecoMarcus
Participante

URL Encoding issue on custom url with email.

Is there any solution in May 2023?

0 Me gusta
tjoyce
Experto reconocido | Partner nivel Elite
Experto reconocido | Partner nivel Elite

URL Encoding issue on custom url with email.

You're not missing anything, unfortunately, it looks like HS might not be encoding the query part of the URL separately from the pre-query. Anytime there is a + sign after the question mark, it is considered a space.

I believe jinja requires a custom filter to convert plus sign to %2B so, they may need to add that to their own codebase internally.

I'm fairly certain you found a legit bug and should consider submitting it. 

matthaltom
Participante

URL Encoding issue on custom url with email.

I'd talked with hubspot support and indeed there is a bug. They are looking to resolve. In the mean time on our side we will have to convert the %20 to %2B so + will work. This is possible only because %20 (a space character) is illegal in email addresses.

CraigDunk
Miembro

URL Encoding issue on custom url with email.

I am having issues using this work around for a link: 

 

https://example.com/register?email={{ "fake+test@example.com"|replace("+","%2B")}} in an email link produces %2B in the resulting url, 

 

but 

 

https://example.com/register?email={{ contact.email|replace("+","%2B")}} 

 

does not and produces a %20

 

On the assumption that contact.email is already encode I tried replacing "%20" (and  litereral space " " in case it was rendered already...).  

 

It seems like it might be decoding the %2B back to a plus sign, and then processing back into a space in the scenerio with the contact.email variable. 

 

If anyone has a working example of this in a button link url within a hubspot email that would be awesome. 

 

0 Me gusta