I’m trying to send a triggered email to new contacts after clicking a button but I’m receiving Bad Request: Please check the user inputs.
here is my code:
wixCrm . createContact ({
"firstName" : $w ( '#input1' ). value ,
"emails" : [ $w ( "#input2" ). value ]
}). then (( contactId ) => {
console . log ( contactId );
wixCrm . triggeredEmails . emailContact ( 'donation_receipt' , contactId , {
variables : {
WelfareProject : $w ( '#input4' ). value ,
DonorName : $w ( '#input1' ). value ,
DonationAmount : $w ( 'input3' ). value
}
}). then (( email ) => {
console . log ( "Email sent: " + email );
}). **catch** (( emailErr ) => {
**let** mailErr = emailErr ;
console . log ( mailErr );
});
});
Can anyone help me