Triggered email not sending!

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 );
});

}
});
});


The code seems correct to me. Can you check if there are any spelling mistakes, like the one where you have to write the triggered emailId. Or check the spelling for variable names.

If that does not solve this problem, can you try sending the triggered email on a button click? If that works, then there is some error on dataset save. If that does not work, can you send the error which you are consoling on email send.

I hope this helps

I have tried both button click and onAfterSave, I also can’t see any spelling mistakes :sob:

Perhaps you can find some hints in this video…
https://www.wix.com/velo/forum/tips-tutorials-examples/triggered-emails

Yes I think, the link Velo-Ninja shared can help. If not, you can contact me and I will need to have to check the editor and console to see what exact error is showing up.

For anyone looking for the solution, for me it was a browser issue. I created a new test email account and tried it in an Icognito window.