Hello, I am a bit stuck with sendgrid / wix when trying to send 2 separate emails upon database record update.
When the lab personnel updates the record and chooses to inform the doctor, it sends an email.
This works, but I want to add a second email trigger when the doctor wants to notify the lab of a certain study he wants them to perform.
I can only have 1 "after_update" event
export function hcgenetica_afterUpdate(item, context) {
if (item.informaGenetista === 'SI')
sgMail.setApiKey('SG.fii-L5gSQ6uUzN7wX8z2dFRw');
const msg = {
to: item.genetista,
from: 'coordinacion@genos.com.ar',
templateId: 'd-5ae034e07bfc46da9068304e84e23044wasfsf' dynamic_template_data: {
etc etc
IDEALLY I WOULD LIKE TO ADD ANOTHER ENTRY HERE LIKE THIS:
else if (item.informaLAB === 'SI') +>> send the sencond email template sgMail.setApiKey('SG.fii-L5gSQ6uUzN7wX8z2dFRw');
const msg = {
to: item.labcontact
,from: 'coordinacion@genos.com.ar',
templateId: 'd-5ae034e07bfc46d342347assfd',
Any thoughts?