How we used the Slack API and Cloud Functions to help us keep track of events in our platform
Serverless to the rescue 🙌
Here at GetTruck, we love serverless, it cuts down deployment and configuration of servers by nearly 100%, plus we can now focus on doing the things that matter: Developing solutions for our users ❤️
What is Serverless?
Here is the jargon-filled definition:
Serverless computing is a cloud-computing execution model in which the cloud provider runs the server, and dynamically manages the allocation of machine resources. Pricing is based on the actual amount of resources consumed by an application, rather than on pre-purchased units of capacity. It can be a form of utility computing.
Here is the human-readable definition:
Serverless is a way for developers to run their code in the cloud without worrying about deploying or configuring a server. You just deploy your code and it works (if it is written correctly). Serverless allows us to pay for what we use instead of paying a fixed price, the cloud provider takes care of scaling and management of the servers.
What are Cloud Functions?
Cloud Functions is a product by Google that builds on top of the idea of serverless.
Cloud Functions - Event-driven Serverless Computing | Cloud Functions | Google Cloud
Google Cloud Functions makes it easy for developers to run and scale code in the cloud and build event-driven…
Cloud Functions allow you to build event-driven systems so you could write a Cloud Function that runs only when changes in your database are made or a Cloud Function that accepts HTTPS request for a managed API endpoint. The possibilities are endless 😉
Why would we need a SlackBot?
The answer is pretty simple, instant notifications. We want to know when a user has submitted a move request or when a transporter has quoted on that user’s move request.
You could do this via email but email lacks that real-time feel as well as, lack of customisation such as:
- Text formatting
- Custom action buttons
- Messaging control
The Slack API allows you to do the above mentioned things that email just cannot.
Slack has built an amazing API for developers to build great tools on top of, you can utilize webhooks to send push notifications to a channel of your choice in your team’s workspace, that’s exactly what we did with the GetTruckBot
The GetTruckbot is super cool, by utilising the Slack API and Cloud Functions we were able to build a complete user-lifecycle notification system
Here is an example of a lead coming in through our platform
The great thing about the Slack API is that it allows you to create custom action buttons. Here we have two buttons: View Lead and Contact via WhatsApp
View Lead allows us to preview the user’s move request and using the WhatsApp Business API we are able to generate a link to contact the user using their phone number via WhatsApp Business, this reduces the friction for time-to-first-contact
Our bot is pretty simple but it adds a ton of value in keeping track of where our clients are within the platform 👀
Sometimes rolling your own custom service might take a ton of time but by using existing platforms such as Slack and WhatsApp and figuring out how to connect the two can really benefit your business
If you want to try building your own SlackBot, check out the Slack API documentation
Thanks for taking the time to read this article, hope you have gained something of value ❤️