iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🎉

Send Notion Announcements to Slack

に公開
2024/05/02

Introduction

I prepared an announcement on the internal Notion portal and want to send Slack notifications for it.

  1. (Manual) Add a record to the Notion announcement database and set the status to "Before Delivery"
  2. (Automatic) GAS runs every 10 minutes
    • Retrieve the record list and get items marked as "Before Delivery"
    • Slack notification
    • Change the status of the corresponding record to "Delivered"

Notion

Notion Template
https://www.notion.so/templates/slack-notify

Note that the templates within Notion reference the following blogs:
https://blog.jnito.com/entry/2019/12/30/085601
https://business.nikkei.com/atcl/gen/19/00280/040900001/

Additionally, I have posted an "Unconfirmed" view on the internal Notion top page. The intended workflow is:

  1. People who haven't seen Slack check the announcement on the top page
  2. Once confirmed, they press a button labeled "Confirmed"
  3. It then disappears from the unconfirmed view, allowing them to hide items they have already checked

I believe this approach works well.

GAS

Refer to the following for the NotionManager library:
https://zenn.dev/nag8/articles/4fa5aa95f69577

For notifications, see here, etc.:
https://zenn.dev/nag8/articles/66e32e53edb343

Addendum

2024/04/08

https://github.com/nag8/NotionManager/blob/7c2206819fc44f9cb1379989570873d2f8a83b06/src/class/NotionRecord.js
I have updated it to post text content from within Notion pages to Slack. While images and other elements are not yet supported,

  • paragraph
  • heading_1
  • heading_2
  • heading_3
  • bulleted_list_item
  • bookmark
    are converted into Slack formatting before being posted.

Discussion