Triggered Email Not Working

I am trying to have an email sent to a site visitor .
When the enter their email address in the text field, and click the login button, an email should be sent to the address they provided but I am getting an error.

here is the error I get upon clicking the login button:

Please post a larger portion of your code (especially the part where you trigger the function), but not as screenshot. Copy and paste the code in a code snippet block

// Velo API Reference: Introduction - Velo API Reference - Wix.com
import wixData from ‘wix-data’ ;
import { triggeredEmails , contacts } from ‘wix-crm’ ;

$w . onReady ( function () {
$w ( ‘#button1’ ). disable ();
});

/**

  • Adds an event handler that runs when the element is clicked.
    Read more
  • @param {$w.MouseEvent} event
    */
    export function logInEvent ( event ) {
    let variable = “” + $w ( ‘#input1’ ). value ;

contacts . appendOrCreateContact ({
name : {
first : $w ( ‘#input2’ ). value
},
emails : [{
email : $w ( ‘#input1’ ). value
}]
})
. then (( contactInfo ) => {
const contactId = contactInfo . contactId ;
console . log ( contactId + " - contactid" );
triggeredEmails . emailContact ( ‘TZC3C2J’ , contactId , {
variables : {
code : 123456
}
})
});

}

I don’t see the event listener that triggers this function.