8000 GitHub - azu/gmail-to-notion: Google Apps Script: Search Gmail and record the search results in Notion.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Google Apps Script: Search Gmail and record the search results in Notion.

License

Notifications You must be signed in to change notification settings

azu/gmail-to-notion

Repository files navigation

Gmail to Notion

定期的にGmailを検索し、検索結果をNotionに記録するGoogle Apps Script.

Search Gmail periodically and record the search results in Notion.

graph TD;
  GAS-->|Search|Gmail;
  Gmail-->|Search Result|GAS;
  GAS-->|Record|Notion;
Loading

ユースケース

  • 特定のラベルをつけたメールを検索し、その結果をNotionに記録する
  • Record the search results of emails with specific labels in Notion

Setup

  1. claspでGoogle Apps Scriptのプロジェクトを作成する
npm ci
npx clasp login
npx clasp create --rootDir ./dist
cp appsscript.json ./dist/
touch .env
  1. .envファイルを作成し、以下のように設定する
    • op runで読み込んで利用することを想定している
# Search Query
SEARCH_QUERY="{label:A OR label:B}"
# Notion Token
NOTION_TOKEN="secret_XXXXXXXXXXX"
NOTION_DATABASE_ID="xxxxxxxxxxxxxxxxxxxxx"
NOTION_PROJECTS_ID="xxxxxxxxxxxxxxxxxxxxx"
# 送信したメールを記録するかどうか
IS_SAVE_IN_SENT=true
  1. npm run deployでデプロイする
npm run deploy

仕組み

  • 検索して、その結果をNotionに記録
  • 一度記録したものは、再度記録しない

Notionのデータベース構造

  • src/notion.tsを参照して変更する
  • プロパティ
    • タスク名
    • Projects
    • URL
    • Tags
      • Multi-selectのタグ
      • Gmail::<ラベル名>の形式で記録される

License

MIT

About

Google Apps Script: Search Gmail and record the search results in Notion. 6BF5

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published
0