Because collecting emails should be easy.
A simple dump for your email signups.
It's a simple Flask application using Gevent that persists signups in a MongoDB database. It's meant to be hosted on Heroku with the MongoLab add-on.
git clone https://github.com/dskang/email-bin.git
cd email-bin
heroku apps:create
heroku addons:add mongolab
git push heroku master
- Once you have the server running on Heroku, you can simply create a form with a text field and submit button anywhere* and set the 'action' attribute to YOUR-HEROKU-APP-URL/signup. Look inside the example directory for help. In other words, all you need is add the following snippet to your site:
<form class="email-form" method="post" action="<YOUR-HEROKU-APP-URL>/signup">
<input class="email" name="email" type="text" placeholder="Email address">
<button class="submit" type="submit">Sign up</button>
</form>
*Email Bin allows cross domain requests, so Email Bin does not need to
reside on the same domain as your actual site. This means that
XMLHttpRequests can be invoked from any domain; if you would like to
restrict the domains that are allowed to do this, change the
ALLOWED_DOMAINS
in app.py to the URL of the site containing your form.
pip install -r requirements.txt
If you have issues installing gevent, runbrew install libevent
.- Run
heroku config | grep MONGOLAB_URI
and copy the MONGOLAB_URI into a new file named .env, using sample.env as a guide. foreman start