Here is the code I’m running to try to send triggered emails to users who fill out my form:
I’ve consoled out the contact info and it’s properly passing a non null first and last name as well as email and phone number. I know that the issue with this is the contacts.createorappendcontact() function. When logging out the ‘contactId’ response from the contacts.createorappendcontact() function it seems that the contactId is undefined so it appears that it’s not actually creating a contact.
The error I get is “error”, so it’s not very useful. The error comes from the triggerEmails function, but that is expected since I pass an “undefined” contact id to it.
Anyone experience this before or can see an obvious issue that I am missing?
Looking forward to your help! Thank you so much.
Hi @dsimon-sci ,
The appendOrCreateContact() function returns a promise that should result in a “ContactIdentification” object.
This means to access the contactId from the newly created contact you will need to do something like this:
contacts.appendOrCreateContact(contactInfo)
.then((result)=> {
const contactId = result.contactId;
})
Let me know if you need further guidance! 
Thanks for your help!! I was able to get the createContact function to work, but now the email sending functions with triggered emails isn’t working. Here is my code snippet for triggeredEmails:
Just putting in dummy values to see if this works. But when I run this I get this error:
I get a “Bad Request: please check user inputs” error. I’m basically just copy and pasting the code snippet that is given to me from the triggered emails panel.
Anything in my code that you notice off the bat that could be causing this?
Another issue I am running into is that the appendOrCreateContact function is working but it isn’t actually adding a contact to my six dashboard. It evens returns to the me the contacts ID, but I don’t see the contact in my dashboard. Not sure if I’m looking in the wrong place or the contact isn’t being created properly.
Hey!
I am running into the same issue, have you found a solution?
Hi Thomas!
Could you look into the issue of dsimon.sci? I am experiencing exactly the same with the default code. The “please check user inputs” error. Thanks in advance!
Mathieu