I have created a simple Email Template to triggered it before login to site
On Back end code i have written below function and calling it from front end (Login Page),
Now getting error from Log
“jsonPayload”:{
“message”:"Error: Error: Unable to handle the request. Contact the site administrator or view site monitoring logs for more information. "
}
//Login.jsw
export async function SendEmailForContact(EmpEmail)
{
const queryResults =await contacts.queryContacts()
.eq('info.emails.email', EmpEmail)
.find();
let QResult=queryResults.items;
if(QResult.length>0)
{
let ContactId=QResult[0]._id;
const triggeredEmailTemplate = 'My Template Name with no variables';
try
{
await wixCrmBackend.triggeredEmails.emailContact(triggeredEmailTemplate,
ContactId);
} catch (error)
{
console.error(' error #%d ',error);
}
}
}
Please help