Question:
Hello everyone
I created 2 “triggered emails” which must be sent to a very specific customer in my database at 2 very specific times: after registration and after validation of their reservation.
When the customers enters their data, they are saved in a collection called “Mes Clients”. At this time, I would like this same customer to receive the triggered email that I named: “EnregistrementValide”. (to the email saved in “MesClients” Collection corresponding)
My PB: customer data is well recorded in my “MyClients” collection(mail, LAstName, Firstname, etc…) , but the email is not sent to them.
Can you help me please?
My (important) fields :
- lastName
- firstName
- EnvoiMailClt : My dataset (MesClients)
P.S : i watched some videos on the web and i found some solutions : but don’t work, and i don’t really understand them.
Thank you in advance
Product:
Wix EDITOR
What are you trying to achieve:
Send a triggered email.
**Here the code i use : **
$w(“#EnvoiMailClt”).onReady(() => {
$w(“#EnvoiMailClt”).onAfterSave(() => {wixCRM.createContact({ "firstName": $w('#firstName').value, "lastName": $w("#lastName").value, "emails": [$w("#email").value] }).then((contactId) => { triggeredEmails.emailContact('EnregistrementValide', contactId, { variables: { firstName: session.getItem("firstName"), lastName: session.getItem("lastName"), email: session.getItem("email") } }); }); // }); //$w("#firstName, #lastName, #email").onInput(() => { session.setItem("firstName", $w("#firstName").value) session.setItem("lastName", $w("#lastName").value) session.setItem("email", $w("#email").value) //})
})