Frontend form action (with ReCaptcha?)

Description of issue or problem I’m having:
I have a requirement to create a plugin with a front-end form through which the users can submit information to the site admins.

I need to be able to validate the form (already handled with Boostrap 5, and that’s working).

I also need to include ReCaptcha to prevent spam submissions, if possible, and to automatically email the site admins with the form contents. However I’m unsure how to do either of these things and was hoping that there were some working examples somewhere that I could refer to.

Steps I took leading up to the issue:
I have created the form, but don’t know what form action to use - which url, or would that be something in the smarty templates?
Once the form is submitted (when I know the action to take) then I would need to be able to send the form contents to the site admins using the normal mail functionality - are there any examples of this in action?

What I tried to resolve the issue:
I have been reading forum posts and using Google to investigate as much as I can.
I have activated Captcha in config.inc.php and that is being displayed on the registration form, however I don’t know how to include the widget on my own front-end page template and to process the result from Google.

Application Version - e.g., OJS 3.1.2:
OJS 3.3.0.10

Any advice or guidance would be gratefully received :slight_smile:

Replying to myself here! I basically just removed the form action entirely (HTML5) and the form will submit to itself, and I can intercept that in the page handler (is the csrf token is set for instance) but there is no $_POST data apart from the csrf token.

Update
I noticed that I had forgotten to put the name=“xxx” attribute in the input fields!.. silly me. The post data is now appearing.

Now I just need to suss out how to email that lot to the site admin - any ideas?