PLEASE HELP***
I’ve now be able to submit without any errors on preview, however I’m not getting any triggered emails?
Anyone able to advise where I am going wrong?
import wixCRM from 'wix-crm';
$w.onReady(function () {
});
export function button1_click(event, $w) {
if ($w('#radioGroup1').value === 'Yes') {
wixCRM.createContact({
"firstName": $w('#input1').value,
"emails": [$w("#input2").value],
"Responce": $w("#radioGroup1").value
})
.then((contactId) => {
wixCRM.emailContact("Qy1ReCD", contactId, {
"variables": {
"name": $w('#input1').value,
"interest_area": $w("#radioGroup1").value
}
})
.then(() => {
// do something after the email was sent
})
.catch((err) => {
// handle the error if the email wasn't sent
});
});
}
else {
wixCRM.createContact({
"firstName": $w('#input1').value,
"emails": [$w("#input2").value],
"Responce": $w("#radioGroup1").value
})
.then((contactId) => {
wixCRM.emailContact("Qy1K8NW", contactId, {
"variables": {
"name": $w('#input1').value,
"interest_area": $w("#radioGroup1").value
}
})
.then(() => {
// do something after the email was sent
})
.catch((err) => {
// handle the error if the email wasn't sent
});
});
}}