Simple API that you can call when you make a static website and you need a contact form.
Fiels:
- name
- subject
- message
$ curl --data "[email protected]" ruby-contactform.herokuapp.com/user/register
{"status":200,"message":"a3484djd-7d2c-4dq1-bs01-9s3861bf1942"}
Test your token
$ curl --data "name=Jane Doe&[email protected]&subject=Hello stranger&message=Lorem ipsum" ruby-contactform.herokuapp.com/user/a3484djd-7d2c-4dq1-bs01-9s3861bf1942
{"status":200,"message":"success"}
<form method="POST" action="http://ruby-contactform.herokuapp.com/user/a3484djd-7d2c-4dq1-bs01-9s3861bf1942">
Name: <input type="text" name="name"><br>
Email: <input type="text" name="email"><br>
Subject: <input type="text" name="subject"><br>
Message: <textarea name="message" cols="20" rows="5"></textarea><br>
<input type="submit" value="Send!">
</form>
Feel free to host it on your own server. Simple as below.
Example heroku:
$ git clone https://github.com/radubogdan/ruby-contactform.git
$ heroku create
$ heroku config:set REDISTOGO_URL="redis://redistogo:[email protected]:10499/"
$ heroku config:set SENDGRID_API_KEY=xA-JfjUFJkfjsJFnjZ
$ git push heroku master
See the License file.