Skip to content

dali-lab/simple-contact-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Server for Static Website Contact Forms

A simple contact form for static websites. This is a simple Flask app that uses Heroku with the Sendgrid addon. Based on Mandrill version from: https:/ousenko/simple-contact-form

  1. Create account on heroku.com and download heroku toolbelt

https://toolbelt.heroku.com/

  1. Create a heroku app and add sendgrid

$ git clone [email protected]:dali-lab/simple-contact-server.git
$ heroku create <YOUR_HEROKU_APP>
$ heroku addons:create sendgrid:starter
$ heroku config:set USER_EMAIL=<YOUR EMAIL>
$ heroku config:set USER_SITE=<http://YOUR SITE>
$ heroku config:set SUCCESS_PAGE=<http://A SUCCESS PAGE TO REDIRECT USER TO AFTER THE MESSAGE IS SENT>
$ git push heroku master

note heroku automatically configures the sendgrid username and password

to test you can run this:

$ curl --data "name=somename&[email protected]&subject=test&message=testing more more more" https://<YOUR_HEROKU_APP>.herokuapp.com/send
  1. Front-end setup

Your form html can be something like this:

<form action="https://<YOUR_HEROKU_APP>.herokuapp.com/send" method="post">
    Email: <input type="text" name="name"><br>
    Name: <input type="text" name="email"><br>
    Subject: <input type="text" name="subject"><br>
    Message: <textarea name="message" cols="40" rows="5"></textarea>
    <input type="submit" value="Send Message">
</form> 

you do need all of name,email,subject,message in your form

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages