top | item 27615512

(no title)

ddnb | 4 years ago

The major thing holding static "wordpress" or any rather simple site back is definitely forms. I'm wondering what the best solution to this would be? My guess is forms hosted elsewhere loaded in via JS? Anyone have recommendations on what service to use for this?

discuss

order

PinkPigeon|4 years ago

Yeah POST requests with any sort of advanced functionality will always require some kind of server.

I built a thing that makes static sites, including form handling. BUT, the form handling, inevitably, requires a POST request back to a form-forwarding server that then sends you the enquiry via email (https://pinkpigeon.co.uk). Netlify include form handling for static sites, but it's so pricey that that was one of the main motivators for me to build my own solution.

I am not sure what the best implementation for this would be. Some people may go down the AWS Lambda route or something similar, but that's still just a (albeit highly distributed) server forwarding the request for you.

cunthorpe|4 years ago

This is such a common request that several companies doing exactly this were born and closed shop over the years.

I wrote a little script and placed it on Lambda and it still works years later. There are plenty of pre-packaged examples and templates to do the same.

A simple "static forms" search will show you several hosted and self-hosted options.

dgb23|4 years ago

A form service would have to (incomplete list):

* read from or change db records, possibly not self contained (directly accessing WP tables)

* be generated from a schema that allows for both frontend and backend validation

* said schema might be generated from or amended by db records

* authenticate with and talk to arbitrary external or internal services

* write to and read from the/a file system

* have an authentication and authorization scheme, possibly maintained via sessions

* send formatted email

* ...

So depending on where the service sets its boundary, it becomes either useless or too complex, when the alternative is to just write a module in PHP.

seanwilson|4 years ago

> My guess is forms hosted elsewhere loaded in via JS? Anyone have recommendations on what service to use for this?

I've been using this for years: https://formspree.io/

It's been simple and reliable for me and you can use it as just a regular <form> without JS.