Hubspot started translating the “@” in the email address to the html equivalent “%40”, previously the URL contained the users email address in the URL with the “@” character showing.
Where we own the digital asset in the link URL we have created a translation which works fine. However we send users to third party systems. Is there a way to control the URL configuration and have the “@” show in the email address in the URL again?
Hi @MarkdeLange , I’m still not seeing the issue in the URL or in the form when clicking on that link in your email when sending it to myself as a test: Screenshot by Lightshot
apart from the issue with the “@” in {{contact.email}} we are having similar issues with Spanish characters in {{contact.firstname}} and {{contact.lastname}} which are translated to html: “ñ” and the accents like á, é, í, ó, ú, ü, See image below where í and é have converted to html
.
Is there a way this can be controlled when we output the infrmation in a URL in the way stated?
Hi @MarkdeLange , how are you displaying this info? Are you sending folks to a URL with those properties as query parameters, then taking the query parameters via JavaScript and putting them into the input fields? I want to test just as you are so that there’s no difference in tests.
Also, can you please let me know what browser you’re using and which email client you’re testing with?
The data is sent via the URL, I am not sure how the parameters are picked up. what i do know is that the URL contains the html equivalent of these characters,
The code which picks up the parameters in the link is like: https://domain.com?email={{contact.email}}&firstname={{contact.firstname}}&lastname={{contact.lastname}}
Hi @MarkdeLange , I just tested out your scenario with the query parameter redirect from an email, then used javascript to pull the query parameters from the URL and change the inputs. I unfortunately was still unable to reproduce your issue. I had an email that redirects to this page, then used JS to pick off the query parameters and change the input values. Here’s my code:
<script>
hbspt.forms.create({
portalId: "3430672",
formId: "2f202145-210f-4633-b17b-2120382ffd29",
onFormReady: function($form) {
console.log("ready");
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, '\\$&');
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, ' '));
}
var firstname = getParameterByName("firstname");
var lastname = getParameterByName("lastname");
var email = getParameterByName("email");
$("input[name='firstname']").val(firstname).change();
$("input[name='lastname']").val(lastname).change();
$("input[name='email']").val(email).change();
}
});
</script>
I believe this is an issue with implementation, rather than an issue with the HubL tokens like {{ contact.name }}.
That said, I actually don’t think this would be too hard to fix for your developer. Basically, on the landing page once they get sent to the form you have set up, all you’ll need to do is decode the URI component so that those characters get displayed properly, rather than being urlencoded. The function is decodeURIcomponent. This will, for example, take a last name like “URRUTIA%20DE%20DIEGO”, and when you run the function on it like this: decodeURIcomponent("URRUTIA%20DE%20DIEGO") , it will just decode those %20 signs and output “URRUTIA DE DIEGO”. This should fix the issue you’re seeing here.
Hi @cbarley I came across this post and I am really hoping you can help us out. We are having a very similar issue and by implementing your code I think we can get there but it is spitting out an error.
This code almost works:
<script>
hbspt.forms.create({
portalId: '******',
formId: '********-*****-****-****-***********',
inlineMessage: 'Thank you! Time to calculate now',
onFormSubmit: function($form){ setTimeout( function() {
var formData = $form.serialize();
window.location = "https://procobots.com/wp-content/angular-app?" + formData; }, 250 ); // Redirects to url milliseconds.
}
});
</script>
However it is pulling literally ALL form data so then the redirect link goes to a 404. I really only need the email to pass so we can link the two forms data together when they come through the API. Any suggestions?
Is there a fix for this? I am trying to pass data from HubSpot form completion to a Typeform URL in effort to pre-populate data in Typeform and it does not recognize email with the encoded %40 for an @ symbol.