I have a triggered email that is supposed to be sent once a user submits a form. My code is telling me that the email has been sent upon submission, however no email actually appears in the inbox or in spam.
I have no idea what I am missing. Please help!!
Here is my code:
import wixUsers from ‘wix-users’ ;
$w ( “#Dataset” ). onReady (() => {
$w ( "#Dataset" ). onAfterSave (() => {
if ( wixUsers . currentUser . loggedIn ) {
const userId = wixUsers . currentUser . id ;
wixUsers . emailUser ( "my_triggered_email" , userId , {
variables : {
"firstName" : $w ( '#input' ). value
}
})
. then (() => {
$w ( ‘#emailSentText’ ). show ();
console . log ( “email successfully sent” );
})
. catch (( err ) => {
// handle error that prevented the email from being sent
console . log ( err );
});
}
});
});