Skip to content

Instantly share code, notes, and snippets.

@Albert221
Last active September 11, 2019 20:21
Show Gist options
  • Save Albert221/834f33842280947abc3d7e5d226a7328 to your computer and use it in GitHub Desktop.
Save Albert221/834f33842280947abc3d7e5d226a7328 to your computer and use it in GitHub Desktop.
Contact form endpoint CONCEPT

Contact form endpoint

Do you want to have a simple, static website that the only dynamic thing is a contact form? You don't want to go serverless and/or use formspree.io, AWS Lambda or similar? I got your back.

With this Contact form endpoint all you need is a hosting with PHP (cheapest one will do) and a text editor to configure few things (or leave it with defaults).

What you also need is a basic knowledge of HTML to connect the form to the endpoint or some knowledge about XHR to take advantage of the JSON support to make your contact form work without a refresh!

Features

  • Working OOTB using mail and SQLite
  • Simple YAML/INI configuration
    • SMTP credentials
    • HTML form fields names
    • Database creds (SQLite/MySQL; for antiflood)
    • JSON response messages
  • Supporting both text/html and application/json requests
  • Custom email templates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment