Thanks so much for this. It is substantially different to the sample code supplied by Wix that did not work - although the predefined set fields might have been the reason. The way I read it, the Wix article seemed to encourage the use of custom fields and no mention of the predefined fields.
Your use of the constactInfo also made sense. Once I get more confident - might expand its use.
As far as the triggered email id there is a wix walkthrough were they encourage one to set a new name for the triggered id. In this context seems to be working.
Thank you for also adding the logging - something I have also been trying to clarify.
The code runs but with two complications
- In the preview window it runs regardless of whether data validation is successful or not - i.e. has a field been completed. I will read up further to see if there is any way of only running it if all the fields are validated first. I am not sure if it runs on a live page if not validated but suspect it does;
- In preview mode it stopped with an error when it picked up a duplicate email. Do you have any suggestions to communicate that message to the user ?
Thanks once again.