0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GAS Slack通知

Posted at

GAS Slack通知

function slackNotification(){
  let hookUrl = 'https://hooks.slack.com/services/XXXXXXXXX/ZZZZZZZZZZZ'; // 事前に発行したWebhookUrl
  let body1 = '<!here>\n' + '全体通知したい内容を記載';
  let body2 = '<@sato.taro>\n' + '個別通知したい内容を記載';
  let data = {
    "channel": "#チャンネル名",
    "username": "【テスト】Slack通知",
    "text": body1,
    "icon_emoji": ":好きなSlack絵文字:"
  }
  let payload= JSON.stringify(data);
  let options = {
    "method": "POST",
    "payload": payload
  }
  UrlFetchApp.fetch(hookUrl, options);
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?