Hi,
I am trying to use a members email as the final part of the url in a dynamic page eg: www.mywebsite.com/members/{email} . But the @ sign in the email address is being turned into %40.
So when I try to use wixLocation.to current members email that directs to tims@email.com but the URL for the dynamic page is tims%40email.com .
Here is the code for the redirect:
let userEmail;
wixUsers.promptLogin( {"mode": "login"} )
.then( (user) => {
return user.getEmail();
} )
.then( (email) => {
// check if there is an item for the user in the collection
userEmail = email;
})
export function profilebutton_click(event) {
wixLocation.to(`/members/${userEmail}`);
}
I have read that you need a URL decoder when using the @ sign but I am not sure if that is possible with wix.
Maybe i could change all @ signs in userEmail with %40 but I am not sure how I would do that.
All help is appreciated.
Thank you so much!
Ps: I know that it is prompting a login but i dont think that matters here. Let me know if I am wrong.