Hello!
I created a “social media” site that allows users to visit and post on each other’s profiles. I’d like to incorporate a means of notifying clients when someone has filled out a custom form on their page. As a result, I tried to use a triggered email. Here’s the code that I used.
let url = wixLocation.url;
getHostID(url).then(hostID =>{
wixUsers.emailUser(“emailID”/actual ID subbed here/, hostID)
.then( () => {
console.log(“Triggered email sent. Hooray!!”);
} )
. catch ( (err) => {
console.log(err);
} );
})
However, when I run it, I get the following error message:
contactId does not match current session contact (401)
It’s true. The contact ID won’t match the current session ID, because I want the host page owner to be notified, not the current user. Is there any way to get around this?
I’ve been working with Wix Code/Corvid for a few months now, but still have a lot to learn. I would really REALLY appreciate any help that could be offered.
Thanks!