Hello all!
I am having problems with the Triggered Email tutorial on wix. The problem is that it works with @yahoo.com emails, but when someone types in a “@gmail.com” emails it doesn’t work
Here is my code.
import wixLocation from ‘wix-location’;
import wixCRM from ‘wix-crm’;
$w.onReady( function () {
$w(“#enviado”).hide();
})
export function input1_keyPress(event) {
let key = event.key; // “@”
if (event.key === “.”) {
$w(“#ebook”).enable();
}
}
export function ebook_click(event) {
$w(“#enviado”).show();
wixCRM.createContact({
“emails”: [$w(“#email”).value],
})
.then((contactId) => {
console.log(contactId)
wixCRM.emailContact("RREYFR4", contactId, {
“variables”: {
}
})
console.log("Triggered email sent");
console.log(contactId)
. **catch** ((err) => {
// handle the error if the email wasn’t sent
});
});
}
Can someone help me with this issue? Thx in advance!