This repository has been archived by the owner. It is now read-only.
Quickstart contact form processing for static sites
Python HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
Procfile
README.md
app.py
requirements.txt
test.html

README.md

Quickstart contact form processing

Update 18-01-18: No longer functional following Mandrill decision to restrict service to Mailchimp subscribers. Archiving this repo for posterity.

This will be useful if...

  • You want to forward a simple contact form to your email
  • You have a (S3) static site and don't want to run a server

Usage

Register your email:

    $ curl --data "email=<your_email>" https://fwdform.herokuapp.com/register
    Token: 780a8c9b-dc2d-4258-83af-4deefe446dee
    

Test (optional):

    $ curl --data "email=person@form.com&name=person&message=hello" \
           https://fwdform.herokuapp.com/user/<token>

Put into action:

<form action="https://fwdform.herokuapp.com/user/<token>">
  Email: <input type="text" name="name"><br>
  Name: <input type="text" name="email"><br>
  Message: <textarea name="message" cols="40" rows="5"></textarea>
  <input type="submit" value="Send Message">
</form> 

NB: Required parameters are: email, name and message. Other parameters will be ignored.

Privacy concerns?

Spin up your own free Heroku instance. A Mandrill account required for email delivery.

    $ git clone https://github.com/samdobson/fwdform.git
    $ heroku create
    $ heroku config:set MANDRILL_API_KEY=<KEY>
    $ heroku addons:add heroku-postgresql:dev
    $ heroku pg:promote HEROKU_POSTGRESQL_COLOR
    $ heroku ps:scale web=1

Deploy the application to your Heroku instance.

    $ git push heroku master

Create the database.

    $ heroku run python
    >>> from app import db
    >>> db.create_all()
    >>> exit()