add dynamic page link to a button

hello @mhammouz
thanks for your help,

I changed the code , I think it’s better to get the current user’s email instead of checking the database so I make it like this but it is still not working , can you please tell me where is the problem?

export function button1_click() {
//Add your code for this event here:

let user = wixUsers.currentUser;
user.getEmail()
.then( (email) => {
let userEmail = email;

wixLocation.to(/student/info/userEmail);
} );
}

I get this error that the page is not here and in the url instead of the current user’s email I just get (userEmail) word