Jeremie:
You probably should be using wix-users.
When a user has logged into your site you can use wix-users.currentUser.isLoggedIn to test to see if your visitor is logged in.
If they are then you should be able to use wix-users.emailUser for example:
import wixUsers from 'wix-users';
$w.onReady(() => {
let thisUser = wixUsers.currentUser;
if (thisUser.isLoggedIn) {
wixUsers.emailUser("R0q92ZI", thisUser.id);
}
});
Now if you are using wixUsers.promptLogin() or wixUsers.login() you can perform this email action in a .then() call since both of these return promises that execute after the login completes.
Hope this helps
Steve