The user id and contact id are different. You need to get the email of the current logged in user, then query it using wix-crm-backend queryContacts() function (This would be need to run on the backend) . When you do that, it shall return an object, which shall have the contact id. This is a very old way
NEW WAY
You have to use the wix-members API to get the contact ID. Please find the code below
currentMember.getMember() returns undefined for me as I technically don’t have a logged-in user. My scenario is:
a new user fills and submits a form - a contact is created for them automatically in wix
they go to another page of my site where I want to get contactId that was just created
I’ve seen that currentMember API is preferable now but my user is not a member but just a contact. Is it possible to get contactId of a user who is currently browsing and just became a contact?
Haven’t tried this myself but you can use the onContactCreated event handler to get and store the contactId from event.entity._id in a variable and then send a triggered email to the stored contact ID.