Question:
I am seeking some help debugging some code. My site uses Triggered Emails and the code is located on a certain page on the site. The snippet is here:
await wixCrm.contacts.appendOrCreateContact({
name: {
first: "first",
last: "last"
},
emails: [
{ email: "email_1", primary: true },
{ email: "email_2", primary: true },
{ email: "email_3", primary: true },
{ email: "email_4", primary: true },
{ email: "email_5", primary: true }
]
// emails: [{ email: "email_1", primary: true }]
}).then(async ({ contactId: contact_id }) => {
console.log(contact_id)
console.log("Variables", variables)
await myEmailContactFunction("<form_id>", contact_id, variables)
.then(() => { console.log("Emailed Contact") })
.catch(console.log)
})
.catch((e) => { return { res: false, reason: e } })
await wixCrm.contacts.appendOrCreateContact({
name: {
first: "first",
last: "last"
},
emails: [{ email: "email_2", primary: true }]
// emails: [{ email: "email_1", primary: true }]
}).then(async ({ contactId: contact_id }) => {
console.log(contact_id)
console.log("Variables", variables)
await myEmailContactFunction("<form_id>", contact_id, variables)
.then(() => { console.log("Emailed Contact") })
.catch(console.log)
})
The issue is that I want all email addresses (email_1-5) to receive the triggered email, but it appears that only email_1 is receiving it. Any thoughts or suggestions?
Product:
Wix Editor