Yesterday I was discussing with a client answering some of their questions about our solution. Among many other things they were curious about our and how could we notify them in a case of high traffic on their API. Simple! We send you an email if someone is about to reach their API quota. 3scale API management “alert system” Almost at the same time I was answering this question I think I heard myself saying… “wait, what?! emails?!”. Kind of we were not offering a more modern solution.We ended the call, and I was left with a furious willing of hacking around to see how we can improve this experience. I had to find out! This is the story of my morning hack. apologizing Expected result in Slack Connecting blocks🔌🏗 I don’t know about you, but when I think about notifications, I usually think about . That’s where I try to gather all the automatic reporting for the I use. This hack will send notifications to Slack. Slack tools Also, sadly, our engineers won’t have time to build a nice alert API so I will have to work with the source I have: . an email There are many mail APIs like or that will let you get emails and parse them, but that was a lot of overhead to deal with (OAuth, filtering emails, …). The best solution would be to send notifications to a designated email address and parse them there. Context.io Nylas offers exactly this feature with their product. They give you an email address where you can send all emails to be parsed. It includes a parsing UI where you define variables you want to extract. Zapier Parser Finally, to have more flexibility on the message formatting we won’t plug directly Zapier to Slack but instead, use Zapier webhook action to send extracted data to an app hosted on . Glitch We are building a complete serverless solution 😇 Webhook integration form on Slack Setup Slack 🤖💬 To be able to send a message to your Slack team we would need to created an integration. Follow this , it should guide you to configure the integration. There, You will define on which channel the notification will be sent. When you are done, keep the Webhook URL handy, we will need later. Incoming Webhook link Zapier parser UI Setup Zapier parser and trigger 📥⚙️ On Zapier, we will start by configuring the email parser . Once you have an address, send there an example of your notification email so we can setup a template. In few seconds the email should be received by the parser and you should see it appeared. Then, highlight variables you want to extract from the email and give them names. here Once template is defined, we will configure a to connect the email parser with our app. In the , select app to trigger with the action. If you test this step, you should be able to retrieve the message you previously sent to email address. Zap Zap Email Parser New Email Parser The app 🎏💻 The app will expose a route , where Zapier will send a request containing the extracted data. You can check on Glitch and remix it with your own variables. POST /hook my example In the file, you should add values to the variables. Get the Hook URL we previously created on Slack, and add some personality to your notifications adding a username and icon. The variable should be a random string, we will use it to identify that the request comes from Zapier webhook. .env ZAPIER_SECRET The message formatting is happening on the file. You can check the from Slack to run formatting tests. slack.js Message Builder Webhook configuration on Zapier Add webhook action to Zapier 🎣⚙️ Now, that our app is up on Glitch we can add an action to our . Zap Add a Webhook action of type POST pointing to the URL https://YOUR_GLITCH_APP_NAME.glitch.me/hook In should return a JSON payload. Then define the variables that will be sent to the app, and map them we the extracted ones. Secret header for security Finally, for security purpose, we will define a header named with the same value as the environment variable we defined earlier. X-zapier-secret ZAPIER_SECRET Test and enjoy 🎉🎊 And this it, you are done now 👍Test the flow and see if the message renders the way you want. When you are happy with the result, turn the on. Zap Expected result on Slack Now you can ignore email notifications as they are all sent to Slack in a beautiful and comprehensive way. If you want to enhance this flow we can later add , but that needs a bit more work. actionable buttons Let me know what you think of such hacks! Image by Markus Petritz found on Unsplash