Earlier this month when I posted an article about using github pages to host personal website, I added a contact form, beautified it with bootstrap and decided to ignore how would I handle form submissions and keep track of responses. But soon I realized my mistake when someone excitedly asked "Did you get my message I submitted through contact form?". It was disappointing, but I had to say I didn't handle it, yet. So here is how I handled 'it'.
Github pages provides support for static pages and that makes handling forms on static website a bit tricky.
Turns out, capturing data from forms such as contact form in static website is super easy, with little or no configuration needed. There are many free and paid services available according to your requirement. Initially I tried one open-source service formspree, and then for better control I used Google Apps Script.
First approach: FORMSPREE
It's absolutely simple approach, no configuration is needed in your code. Here's is what you do:
Go to https://formspree.io/ and follow steps as mentioned in website.
Just don't forget to add 'name' attribute to your each input field of your form.
Here's what your form would look like after mentioned changes. Look closely at added name fields in html form. email field with '_replyto' is important to capture email id of person who submitted form.
Git is widely used version control system for managing source code and enhance collaboration.
Most important thing to take care while working with git is that you must be aware of branch you are working on, so that you don't accidentally make changes in wrong branch of your repository. This tricky in terminal as it doesn't show git branch name.
We can customize terminal in such a way that it shows current branch name of repository you are working on and reduces chances of making changes to wrong branch to great extent.
Here is how to do that:
Open bashrc file.