Featured image of post Learn How to automate slack message with google appscript free

Learn How to automate slack message with google appscript free

Learn How to automate slack message with google appscript free

This tutorial describes how to automate the slack messages with google apps script for free of cost.

This tutorial describes how to automate the slack messages with google apps script for free of cost. Yes you read it right, We do not need the server for the webhooks of slack.

What is the webhook of slack?

Slack Webhook allows users to send data to slack easily from outside APIs or resources. This can be a very useful feature to make a better notification system. You do not need to go through the email for important notification.

Create a google apps script project

googleappscript.gs

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
const sendMessageToSlack = () => {
    const WEBHOOK_URL = YOUR webhook from slack
    var payload = {
     "channel" : "#watercooler",
     "username" : "",
     "icon_url" : “”,
     "text" : `Hello Team :memo: This is the important Updates, *Sales Team* please have a look :face_with_monocle:`,
     "attachments": [{
       // "text": `:memo: ${quotes[quoteNumber].quote}`,
       "text": ADD any text,
       "footer": "<”YOUR_GOOGLE_SHEET_URL”|edit script>",
       "mrkdwn_in": ["text"]
     }]
   }
  var options = {
   "method" : "post",
   "contentType" : "application/json",
   "payload" : JSON.stringify(payload)
 };
 var results = UrlFetchApp.fetch( WEBHOOK_URL , options);
 }

Set triggers

I prefer my notification code daily in the morning, You can adjust your time by changing drop down.

How to set triggers in Google AppScript

Test integration

Test google apps script function by clicking the run button. Please select appropriate function to run.

How to run function in Google AppScript

Creativity

You can be creative with your code as much as you can. Few ideas for slack notification. Create downtime monitor Track domains and subscription monitor Track credit card due dates Track some specific rules by own

This list is very long and it is free to use. You do not need to pay for sass tool once you developed your desired solution.



If it is helpful and saves your valuable Time ⏱ please show your support 👇. Buy Me A Coffee
Buy me A Coffee, Thank you and canva ( For Beautiful designs ). Thanks for the reading 👍.
Built with Hugo
Theme Stack designed by Jimmy