Triggered Email code not working

Hi,
This is my first time working with an automation in WIX and I followed the “create a triggered email” instructions but I am having no results.
I have tested the code about a dozen times, looking in the forums and in the documentation for help but nothing I do triggers the email to send.

Here is my code; please advise if I have missed anything! TIA

You need to move the onReady call up above your export function, get rid of line 5 as you’ve already called it in the export function and add the then and catch code to the end of your code.

With your export function, make sure that you have got the onClick event in the properties panel turned on for your signup button
https://support.wix.com/en/article/corvid-reacting-to-user-actions-using-events

Full code from the send triggered email to contacts tutorial:

import wixCRM from 'wix-crm';

$w.onReady(function () {

});

export function signUpButton_click(event) {
 wixCRM.createContact({
   "firstName": $w('#nameInput').value,
   "emails": [$w("#emailInput").value],
   "interest_area": $w("#interestArea").value
  })
  .then((contactId) => {
   wixCRM.emailContact("newsletter_signup", contactId, {
     "variables": {
      "name": $w('#nameInput').value,
      "interest_area": $w("#interestArea").value
     }
    })
    .then(() => {
     // do something after the email was sent
    })
    .catch((err) => {
     // handle the error if the email wasn't sent
    });
  });
}