How To Use FormsenderΒΆ

In conf.py.dist there are several settings that Formsender relies on. To use these settings copy them to a new conf.py file in the root directory. You can change the following variables to match your setup:

EMAIL = u'email@example.com'
TOKN = u's0m3T0k3n$tr1ng'
CEILING = 10
DUPLICATE_CHECK_TIME = 3600
HOST = "0.0.0.0"
PORT = 5000
SMTP_HOST = "smtp.osuosl.org"
FROM = "formsender@osuosl.org"
  • EMAIL is where the form data will be sent.
  • TOKN is the validating token from the form. This must match a hidden field in your form called ‘tokn’. You can find and set the TOKN variable in your conf.py file. Just make sure you also set the hidden tokn field value to match.
  • CEILING is the maximum number of submit requests formsender will accept per second.
  • DUPLICATE_CHECK_TIME is the time (in seconds) to check past form submissions for duplicate submissions.
  • HOST and PORT is where the run_simple listener listens for POST requests
  • SMTP_HOST sets the host for the sendmail function. Must be a smtp server
  • FROM is the address the email will be sent from

You can run flake8 on request_handler (the application):

$ make flake

Once a valid conf.py file exists, tests can be run:

$ make tests

To run the application locally for development purposes:

$ make run

The app will now wait at HOST:PORT for the form to be submitted, and will email the information submitted to the email specified. HOST and PORT can be changed in conf.py to match your desired setup.