I want to use Wix code to send an automated email out to my users when they log in. I’m using the code snippet below, and I’ve console logged my way through it, and everything seems to make sense, but the emails don’t seem to be being sent out:
$w("#dataset1").onAfterSave( () => {
wixCRM.createContact( {
"emails": [$w("#input2").value]
} )
.then( (contactId) => {
wixCRM.emailContact("R0q92ZI", contactId, {
"variables": {}
});
} ).catch(error => console.log(error));
})
Additional context: I’ve checked my spam folder and haven’t found anything there. No error is being thrown, either, and I’ve confirmed that $w("#input2").value is indeed a correct email address when I test it.
Does anyone have an idea about what might be going on here?