Triggered email not working

Hi, I’m using the example code snippet from the “Send triggered email to contacts” help page, but it doesn’t seem to be working. I created the template email and tried putting a console.log in both the ‘then’ and ‘catch’ clauses to see what’s happening. Neither are entered by the code so I see no trace output. Also, no email is sent from either PREVIEW or PUBLISHED SITE. Any ideas?

import wixCRM from ‘wix-crm’ ;
wixCRM . createContact ({ “emails” : [ $w ( “#txtEmail” ). value ] })
. then (( contactId ) => {
wixCRM . emailContact ( “Sq9Mdwq” , contactId )
. then (() => {
wixLocation . to ( “/thankyou” );
console . log (“OK”);
})
. catch (( err ) => {
console . log ( err );
});
});