Take My Form is a easy to implement endpoint for your HTML forms. Perfect for your static/jamstack sites.
It uses FastAPI, smtplib and EmailMessage to take care of everything.
Implementation on the frontend is as simple as:
<form action="https://yourdomain.com/api/submit/your@email.com" method="POST">
<input type="text" name="name" required>
<input type="text" name="subject" required>
<input type="email" name="email" required>
<input type="textfield" name="message" required>
<textarea name="message" rows="4" cols="50">
<button type="submit">Submit</button>
</form>
On submission
- Check if the domain is in the allowed origin list
- Submit if origin (website) domain is in the list
It's as simple as that.
Take My Form is currently in beta (it works as intended).
- Clone this git repo
- Build container
- Create config
- Adjust the config
- Restart container
git clone https://github.com/mentallyinspired/take-my-form.git
cd take-my-form
sudo docker build -t take-my-form .
docker
sudo docker compose up -d && sudo docker compose down
Edit the config in the mapped docker volume
$ docker-compose up -d
Point your form action
to ../api/submit/your@email.com
like:
<form action="https://yourdomain.com/api/submit/your@email.com" method="POST">
- Build working docker container
- Docker-compose file with reverse proxy
- Implement static CORS
- Implement validation process for sending emails
- This will allow the server make use of emails with different domain to the website the form is in
- Probably more