Hi devs!
I managed to make this work in the following way (describing just in case someone else needs similar behavior):
- in the form create 2 fields of type "email", both hidden
- one of them is the email of the person who sends the form - this one has the "Send confirmation to this email" set to false, it is always filled in with proper email
- the other email field is a helper field, which has "Send confirmation to this email" set to true, this one is not filled in (value="")
- fill the helper field (with JavaScript, when clicking send) with the address taken from first email field, but do it only if the "send copy to me" checkbox is checked
- all built-in Webnodes logic is re-used, so I can setup the forms messages templates within webnodes, no need to create new form class and no need to override onSubmit method
Cheers