Custom Software Development and Engineering

Building realtime contact forms that integrate with Slack using Firebase and Google Cloud Platform

Our website has had a contact form at the bottom of each page ever since we revamped the site in late 2014. Our old implementation pushed directly to a sheet document on Google Drive. In theory, this worked perfectly fine, except for the crazy form hacks we implemented to get around cross-domain issues (Google Forms doesn’t like CORS).

This issues, coupled with our want to be as responsive to folks as possible, lead to us exploring a new approach.

This issue came up while we were revamping the site at the end of the year, so we decided that we should have forms contents appear in a particular private Slack channel in realtime. We’re big fans of Slack for team communications and we love the abilty to not only utilize existing integrations with services but also build our own.

Hence, inquiry-bot was born!

Inquiry Bot is a slackbot written in Go that listens to a Firebase endpoint, then relays that information to a Slack channel using webhooks. All the webpage has to do is post form information to the Firebase endpoint for it to appear in Slack; we do this using nothing more than Polymer’s awesome paper-input and gold-inputs in our own custom component (though you can do it any way you like).

To make the bot constantly run, we added the bot into a small docker container, pushed that container to Google Container Engine and deployed a simple container-vm with that image.

The benefit is nearly instant (no pun intended); form results posted from any page on our website instantly appear in the Slack channel of our choice:

Inquirybot in action!

The source code is now avaialble for use and can be found on Github under an Apache 2 license.

Looking for a Polymer element to wire that bot with for your own site? We also released real-time-contact on Github under an MIT license.

Ready to start?

Get in touch. We're ready to listen.