"Failed to fetch" when sending triggered email

I’m using this code but still no luck

export function sendEmail_click(event) {
$w("#dataset1").onAfterSave(() => {
let contactInfo = {
"emails": [$w('#inputEmail').value]
};
console.log(contactInfo);
wixCrm.createContact(contactInfo)
.then((contactId) => {
console.log(contactId);
return wixCrm.emailContact('Ru2ePvr', contactId)
.then(() => {
console.log('Triggered email sent')
$w('#inputEmail').value = '';
})
.catch((error) => {
console.log(`Error: ${error}`)
$w('#inputEmail').value = '';
})
})
})
}