Easy HTML form without PHP or JavaScript

Overview

This repository is no longer active. If you're looking for a simple and powerful hosted form API, please check out https://formspree.io. If you are interested in self-hosting the code in this repository, you may do so while complying with the LICENSE file. However, Formspree can't offer support.

FORMSPREE.IO

Functional HTML forms. Hosted at https://formspree.io.

Just send your form to our URL and we'll forward it to your email. No PHP, Javascript or sign up required — perfect for static sites! Example:

<form action="https://formspree.io/[email protected]">
    <input type="text" name="name">
    <input type="email" name="_replyto">
    <input type="submit" value="Send">
</form>

Setting it up is easy and free. Here's how:

You don't even have to register.

1. Setup the HTML form

Change your form's action-attribute to this and replace [email protected] with your own email.

2. Submit the form and confirm your email address

Go to your website and submit the form once. This will send you an email asking to confirm your email address, so that no one can start sending you spam from random websites.

3. All set, receive emails

From now on, when someone submits that form, we'll forward you the data as email.

Advanced features:

Form inputs can have specially named name-attributes, which alter functionality. They are all prefixed with an underscore.

_replyto

This value is used for the email's Reply-To field. This way you can directly "Reply" to the email to respond to the person who originally submitted the form.

_next

By default, after submitting a form the user is shown the Formspree "Thank You" page. You can provide an alternative URL for that page.

_subject

This value is used for the email's subject, so that you can quickly reply to submissions without having to edit the subject line each time.

_cc

This value is used for the email's CC Field. This lets you send a copy of each submission to another email address. If you want to cc multiple emails, simply make the cc field a list of emails each separated by a comma.

_gotcha

Add this "honeypot" field to avoid spam by fooling scrapers. If a value is provided, the submission will be silently ignored. The input should be hidden with CSS.

Using AJAX

Formspree Gold users can submit forms via AJAX. This even works cross-origin. The trick is to set the Accept header to application/json. If you're using jQuery this can be done like so:

$.ajax({
    url: "https://formspree.io/FORM_ID",
    method: "POST",
    data: {message: "hello!"},
    dataType: "json"
});

If you are experiencing issues, please take a look at the FAQ in the wiki

Running your own copy of Formspree

Running on localhost

You'll need a SendGrid account, PostgreSQL, Redis and Python 2.7 and should install pip, and create a virtual environment for the server.

Once your environment is setup, create a postgresql database, clone the source and cd into the root of the Formspree repository. Then run:

pip install -r requirements.txt

then create a .env file with your configuration like the following:

API_ROOT='http://127.0.0.1:5000'
CONTACT_EMAIL='[email protected]'
DATABASE_URL='postgresql://<username>@127.0.0.1:5432/formspree'
DEBUG='True'
DEFAULT_SENDER='[email protected]'
LOG_LEVEL='debug'
MONTHLY_SUBMISSIONS_LIMIT='100'
NONCE_SECRET='y0ur_n0nc3_s3cr3t'
HASHIDS_SALT='a salt'
REDISTOGO_URL='127.0.0.1:6379'
SECRET_KEY='y0ur_s3cr3t_k3y'
SENDGRID_PASSWORD='<password>'
SENDGRID_USERNAME='<username>'
SERVICE_NAME='LocalFormspree'
SERVICE_URL='http://127.0.0.1:5000'
TEST_DATABASE_URL='postgresql://<username>@127.0.0.1:5432/formspree-test'

Tell the Flask CLI about the application by typing export FLASK_APP=manage.py or if using a virtualenv you can add it to the activate script

Make sure you have a postgresql database called formspree and create the necessary tables by running:

flask db upgrade

And you are ready to run the server:

flask run

Running tests

REDISTOGO_URL='0.0.0.0:6379' \
TEST_DATABASE_URL=postgresql://<username>@127.0.0.1:5432/formspree-test \
NONCE_SECRET='y0ur_n0nc3_s3cr3t' \
HASHIDS_SALT='a salt' \
SECRET_KEY='y0ur_s3cr3t_k3y' \
STRIPE_TEST_PUBLISHABLE_KEY='<STRIPE PUBLISHABLE>' \
STRIPE_TEST_SECRET_KEY='<STRIPE SECRET>' \
python -m unittest discover

Make sure that you do NOT use your actual formspree database when running tests. Doing so will cause you to lose all data located in your formspree database. Instead create a new database called formspree-test.

You can also use Foreman to automate running tests. After installing, run foreman run venv/bin/python -m unittest discover to run the entire test suite. To run a single test file, run foreman run venv/bin/python -m unittest tests.test_users. In this case, it will run only tests/test_users.py.

Running on Heroku

You will need to install the Heroku toolbelt.

Once your environment is setup, clone the source and cd into the root of the Formspree repository. Then run:

heroku apps:create [your project name]

then

git push heroku

Your new project will be running at [your project name].herokuapp.com.

Dependencies

Formspree requires a PostgreSQL database and uses SendGrid to send emails. If you're deploying to Heroku you can get a free Heroku Postgres database and a SendGrid account by running

heroku addons:create heroku-postgresql:hobby-dev
heroku addons:create sendgrid

Configuring Formspree

Take a look at the formspree/settings.py file for a list of environment variables that should be set in order for Formspree to work correctly.

Contributing

Formspree is an open source project managed on GitHub. We welcome all contributions from the community, but please be sure to take a look at the contributor guidelines before opening an issue or pull request.

Comments
  • User option for deleting/disabing forms and deleting submissions

    User option for deleting/disabing forms and deleting submissions

    Changes proposed in this pull request:

    • Allow form owners to delete individual forms
    • Allow form owners to delete individual submissions
    • Allow form owners to disable forms

    Have you made sure to add:

    • [X] Tests
    • [ ] Documentation

    Screenshots and GIFs screen shot 2016-03-15 at 1 20 45 am

    Deploy notes

    ~~No migration/upgrade necessary~~ A new column was added for disabled forms, so now must run heroku run python manage.py db upgrade --app formspree-asm

    Any Additional Information This PR has changed significantly since proposed. Please look below to see updates.

    opened by rohitdatta 23
  • Fix form creation modal

    Fix form creation modal

    Fixes issues raised by @colevscode on the poor state of the form creation modal

    Changes proposed in this pull request:

    • Changes the verification method from checking for a file like /[email protected] to checking for a file like /formspree-verify.txt with email addresses listed inside (newline separated)
    • Adds virtual-dom dependency for handling the multiple states of the form creation modal in a sane way
    • Makes pure-CSS JS-enhanced modals fully-functional back again by checking triggering modals from JS based on the URL has (#)
    • Change a little bit of everything in the layout, colours and display of forms list
    • Changes modal with example form HTML to be copied and pasted from a black-and-white HTML form with 3 standard <input> fields to a declaratedly open HTML layout (with no <input> fields, since these are to be created by the user own imagination and needs) with highlighted markup
    • Changes the concept of "new" form (for design purposes only) to forms without submissions
    • Removes some old code not needed anymor.

    Have you made sure to add:

    • [ ] Tests - no, this is all frontend, we don't have a way to add these kinds of tests

    Screenshots

    screenshot-spooner alhur es 5000 2016-03-29 19-27-39 screenshot-spooner alhur es 5000 2016-03-29 19-26-18 screenshot-spooner alhur es 5000 2016-03-29 19-24-11 screenshot-spooner alhur es 5000 2016-03-29 20-16-05

    enhancement 
    opened by fiatjaf 18
  • Send first form submission along with confirmation email

    Send first form submission along with confirmation email

    As suggested here.

    I have zero design skills, but anyway I had to accommodate the form contents inside the confirmation email, so I made some small changes:

    confirmation submission

    Please make corrections and suggestions.

    opened by fiatjaf 15
  • Cloudfront CDN

    Cloudfront CDN

    Changes proposed in this pull request:

    • Use the CloudFront CDN (or really any CDN) to serve static files

    Have you made sure to add:

    • [ ] Tests
    • [ ] Documentation

    None necessary. CloudFront works right out of the box

    Screenshots and GIFs

    Deploy notes

    Must add the CDN_URL config variable to Heroku and set it to our CDN URL

    Any Additional Information

    opened by rohitdatta 12
  • allow forms to be unconfirmed

    allow forms to be unconfirmed

    This introduces a flow to unconfirm forms. It is as following:

    1. on every submission there is a link to unconfirm, click on that
    2. you'll be redirected to a page with a reCaptcha confirmation
    3. passing that will trigger a new email, now a confirmation to the unconfirmation
    4. clicking on the link that comes in the email marks the form with .confirmed = False
    5. future submissions will show the confirmation screen -- as if the form was never confirmed
    opened by fiatjaf 10
  • Use https in documentation

    Use https in documentation

    As Paul Irish put it:

    The protocol relative URL is now an anti-pattern. If the asset is available on HTTPS, always request it with that. https://www.paulirish.com/2010/the-protocol-relative-url/

    This ensures that forms are always submitted using HTTPS, even on websites delivered by HTTP.


    Fixes partially #85.

    Changes proposed in this pull request:

    • Drop the use of the protocol-relative URL (//host/...) in favor of always using HTTPS (https://host/...).
    • Change the home page URL to HTTPS.
    • Change the API_ROOT config variable: now it must begin with https://.

    Screenshots and GIFs

    See website screenshots over at https://github.com/formspree/formspree/issues/85#issuecomment-197026612.

    icanhazhttps

    Deploy notes

    The API_ROOT environment variable should be changed to start with https://. As I said before, I can make the commit so that it doesn't require changing it, i.e. by hardcoding https:// on forms that use config.API_ROOT.

    opened by mcornella 10
  • Background worker

    Background worker

    Adds a background worker running off Celery.

    Changes proposed in this pull request:

    • Use Flask CLI to launch processes (replaces Flask Script: python manage.py runserver)
    • Add Celery background tasks
    • Use Celery background tasks for failed email sending

    Have you made sure to add:

    • [ ] Tests
    • [ ] Documentation

    Deploy notes

    • Changes the development server launch command
    • Adds in the need for changing production launch script

    Any Additional Information

    This is currently a work in progress and not finished. While there isn't a lot of code, this is a big change and should be reviewed carefully. Additionally, unit tests haven't been written yet.

    opened by rohitdatta 9
  • replacing contact form with a newsletter signup

    replacing contact form with a newsletter signup

    Changes proposed in this pull request:

    • Replaces test form at bottom of page with newsletter signup form.
    • Adds newletter email to settings

    The intention with this change is to use a parser.zaper.com email address, and then create a zap that wires up the email submissions to mailchimp.

    Have you made sure to add:

    • [ ] Tests
    • [ ] Documentation

    Screenshots and GIFs screen shot 2016-06-04 at 7 49 41 pm

    Deploy notes

    I should merge this so that I can quickly configure the zapier / mailchimp integration.

    opened by colevscode 9
  • Site-wide confirmations

    Site-wide confirmations

    New feature

    Changes proposed in this pull request:

    • The form creation API now supports creating forms that are pre-confirmed if the target email was already verified for the user account.
    • The form creation API now supports creating forms verified site-wide. At the moment of the form creation an HTTP request is made to check for the presence of a verification file at the root path of the site that is being authorized.
    • Adds a new boolean column to the forms table, named "sitewide".

    Have you made sure to add:

    • [x] Tests
    • [ ] Documentation

    Demo

    http://formspree-fiatjaf.herokuapp.com/ (say your registered email there if you want a Gold account to test)

    Deploy notes

    Database migration: heroku run python manage.py db upgrade --app formspree-asm

    opened by fiatjaf 9
  • Fancy email

    Fancy email

    Fixes #74.

    Changes proposed in this pull request:

    • Better looking email for all transaction actions:
      • Confirm email for new form
      • Form submission
      • Form reached limit
      • Create formspree account

    Have you made sure to add:

    • [ ] Tests
    • [ ] Documentation

    Existing tests/documentation work

    Screenshots and GIFs

    Sample email account confirmation screen shot 2016-03-03 at 3 40 20 pm

    Deploy notes

    No changes necessary. Will work with exist infrastructure

    Any Additional Information

    None.

    enhancement 
    opened by rohitdatta 9
  • make API much more flexible with different types of incoming requests

    make API much more flexible with different types of incoming requests

    This is a dumb implementation I came up with. It seems to work whenever I test it (after I fixed various quirks and bugs), but there's probably some bug still. Anyway, the present request_wants_json, however, is not foolproof, it is failing and must be changed.

    Most Javascript HTTP libraries, superagent, for example, automatically send the data you pass to them in JSON format and set the Content-Type header to application/json, but don't set the Accept header. And I can't imagine a situation in which someone would send an AJAX request like this and expect an HTML response.

    Also, Angular automatically sets the Accept header to application/json, text/plain, /, and I don't know why but Werkzeug parses it in a way that request.accept_mimetypes['application/json'] is 1, but request.accept_mimetypes['text/html'] is also 1, so it fails.

    Besides this, I think we need to accept a JSON body when the user wants to send it, it will not hurt anyone or anybody to do it (in Javascript it is many times easier to send a JSON body, as the use cases above prove).

    opened by fiatjaf 9
  • React users dashboard

    React users dashboard

    Fixes # . In order for people inside of china to use formspree, I suggest updating the fallowing two changes. Currently, using the domain www.google.com can't access inside of china Changes proposed in this pull request:

    • [Change 1] For from end: 'https://www.google.com/recaptcha/api.js' => 'https://www.recaptcha.net/recaptcha/api.js'
    • [Change 2] For back end API: 'https://www.google.com/recaptcha/api/siteverify' =>'https://www.recaptcha.net/recaptcha/api/siteverify'
    • [Other changes...]

    Have you made sure to add:

    • [ ] Tests
    • [ ] Documentation

    Screenshots and GIFs

    [Insert screenshot or GIFs of old and new behavior]

    Deploy notes

    [Put any changes necessary in order to deploy (such as DB migrations)]

    Any Additional Information

    opened by shamilyli 0
  • Minor changes

    Minor changes

    Changes proposed in this pull request:

    • Use the form id in place of the primary key for unconfirming forms
    • Switch to using the dynamically inlined templates instead of manually inlined forms.

    Have you made sure to add:

    • [X] Tests
    • [ ] Documentation

    Any Additional Information Not sure if I've gotten all the email templates, but I believe I have?

    opened by rohitdatta 4
  • Session tokens

    Session tokens

    Pre-emptive step to disabling user accounts

    Changes proposed in this pull request:

    Have you made sure to add:

    • [ ] Tests
    • [ ] Documentation

    Screenshots and GIFs

    Deploy notes Need to run a DB migration upon deployment. This PR is for adding the columns necessary for session tokens. It will create a session token for all new users moving forward. We will need to manually apply a DB migration that will create session tokens for all existing users and then change the user loader to use the session token.

    Any Additional Information Going forward, these migrations will be used to disable malicious users and implement security features to force the logout of a single user.

    opened by rohitdatta 0
  • Treat URLs ending with .html and slashes or starting with www. as indistiguishable.

    Treat URLs ending with .html and slashes or starting with www. as indistiguishable.

    For all newly registered forms, remove starting 'www.', ending slashes and ending '.html' or '.htm'.

    Then, for all forms, try to fetch not only the url that comes in the Referer (after referrer_to_path), but also its same version without 'www.', without '.html' or '.htm' and without the ending slash.

    All existing forms will match as always. all new forms will be cleaned up and match against their cleaned version, it doesn't matter if their url change to add or remove 'www.', '.html' or '/' later.

    opened by fiatjaf 6
Owner
Formspree
The form solution for any developer
Formspree
Small project to interact with python, C, HTML, JavaScript, PHP.

Micro Hidroponic Small project to interact with python, C, HTML, JavaScript, PHP. Table of Contents General Info Technologies Used Screenshots Usage P

Filipe Martins 1 Nov 10, 2021
JavaScript Raider is a coverage-guided JavaScript fuzzing framework designed for the v8 JavaScript engine

JavaScript Raider is a coverage-guided JavaScript fuzzing framework designed for the v8 JavaScript engine

null 105 Dec 5, 2022
Tweak the form field rendering in templates, not in python-level form definitions. CSS classes and HTML attributes can be altered.

django-widget-tweaks Tweak the form field rendering in templates, not in python-level form definitions. Altering CSS classes and HTML attributes is su

Jazzband 1.8k Jan 2, 2023
Tweak the form field rendering in templates, not in python-level form definitions. CSS classes and HTML attributes can be altered.

django-widget-tweaks Tweak the form field rendering in templates, not in python-level form definitions. Altering CSS classes and HTML attributes is su

Jazzband 1.8k Jan 6, 2023
Code2flow generates call graphs for dynamic programming language. Code2flow supports Python, Javascript, Ruby, and PHP.

Code2flow generates call graphs for dynamic programming language. Code2flow supports Python, Javascript, Ruby, and PHP.

Scott Rogowski 3k Jan 1, 2023
Easy and free contact form on your HTML page. No backend or JS required.

Easy and free contact form on your HTML page. No backend or JS required. ?? ??

0xDEADF00D 8 Dec 16, 2022
GMailBomber is a form of Internet abuse which is perpetrated through the sending of massive volumes of email to a specific email address with the goal of overflowing the mailbox and overwhelming the mail server hosting the address, making it into some form of denial of service attack.

GMailBomber is a form of Internet abuse which is perpetrated through the sending of massive volumes of email to a specific email address with the goal of overflowing the mailbox and overwhelming the mail server hosting the address, making it into some form of denial of service attack.

Muneeb 5 Nov 13, 2022
Resolve form field arguments dynamically when a form is instantiated

django-forms-dynamic Resolve form field arguments dynamically when a form is instantiated, not when it's declared. Tested against Django 2.2, 3.2 and

DabApps 108 Jan 3, 2023
Build GUI for your Python program with JavaScript, HTML, and CSS

https://pywebview.flowrl.com pywebview is a lightweight cross-platform wrapper around a webview component that allows to display HTML content in its o

Roman 3.3k Jan 1, 2023
Learn to build a Python Desktop GUI app using pywebview, Python, JavaScript, HTML, & CSS.

Python Desktop App Learn how to make a desktop GUI application using Python, JavaScript, HTML, & CSS all thanks to pywebview. pywebview is essentially

Coding For Entrepreneurs 55 Jan 5, 2023
Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.

Introduction Swagger UI allows anyone — be it your development team or your end consumers — to visualize and interact with the API’s resources without

Swagger 23.2k Dec 29, 2022
Fully reponsive Chat Application built with django, javascript, materialUi, bootstrap4, html and css.

Chat app (Full Stack Frameworks with Django Project) Fully reponsive Chat Application built with django, javascript, materialUi, bootstrap4, html and

null 1 Jan 19, 2022
We'll be using HTML, CSS and JavaScript for the frontend

We'll be using HTML, CSS and JavaScript for the frontend. Nothing to install in specific. Open your text-editor and start coding a beautiful front-end.

Mugada sai tilak 1 Dec 15, 2021
A Python HTML form library.

Deform Introduction Use cases Installation Example Status Projects using Deform Community and links Introduction Deform is a Python form library for g

Pylons Project 391 Jan 3, 2023
A HTML-code compiler-thing that lets you reuse HTML code.

RHTML RHTML stands for Reusable-Hyper-Text-Markup-Language, and is pronounced "Rech-tee-em-el" despite how its abbreviation is. As the name stands, RH

Duckie 4 Nov 15, 2021
Use minify-html, the extremely fast HTML + JS + CSS minifier, with Django.

django-minify-html Use minify-html, the extremely fast HTML + JS + CSS minifier, with Django. Requirements Python 3.8 to 3.10 supported. Django 2.2 to

Adam Johnson 60 Dec 28, 2022
That project takes as input special TXT File, divides its content into lsit of HTML objects and then creates HTML file from them.

That project takes as input special TXT File, divides its content into lsit of HTML objects and then creates HTML file from them.

null 1 Jan 10, 2022
Lektor-html-pretify - Lektor plugin to pretify the HTML DOM using Beautiful Soup

html-pretify Lektor plugin to pretify the HTML DOM using Beautiful Soup. How doe

Chaos Bodensee 2 Nov 8, 2022
Django-Text-to-HTML-converter - The simple Text to HTML Converter using Django framework

Django-Text-to-HTML-converter This is the simple Text to HTML Converter using Dj

Nikit Singh Kanyal 6 Oct 9, 2022
scrapes medias, likes, followers, tags and all metadata. Inspired by instagram-php-scraper,bot

instagram_scraper This is a minimalistic Instagram scraper written in Python. It can fetch media, accounts, videos, comments etc. `Comment` and `Like`

sirjoe 2.5k Nov 16, 2022