運用 Google Workspace 外掛程式擴充 Gmail 功能
許多電子郵件的目的,就是要讓收件者執行特定工作或達成目標,例如新增日曆活動、填寫表單、預訂服務或使用其他應用程式。不過,收件者必須在沒有任何進一步提示的情況下完成這項工作,通常還要執行許多手動步驟。
您可以使用 Google Workspace 外掛程式自動執行這些工作,為使用者節省時間和精力。當使用者在 Gmail 中閱讀或撰寫訊息時,Google Workspace 外掛程式可以提供互動式自訂 UI,讓使用者以各種方式對訊息採取行動,例如:
- 在 Gmail UI 中為使用者顯示其他資訊。
- 連線至非 Google 服務,以便擷取資訊或執行其他動作。
- 提供控制外掛程式行為或將資訊傳送至其他服務的方法。
Google Workspace 外掛程式可在 G Suite 中定義下列類型的擴充功能:
此外,Google Workspace 外掛程式可在桌面和行動用戶端上擴充 Gmail 功能。
Gmail 首頁
Gmail 支援顯示 Google Workspace 外掛程式首頁。如要在 Gmail 中顯示外掛程式的常用首頁,請確認外掛程式的資訊清單中含有 addOns.gmail
欄位。
或者,您也可以在外掛程式資訊清單中新增 gmail.homepageTrigger
,提供 Gmail 專屬的首頁。
無論是哪種情況,您都必須在外掛程式指令碼專案中提供首頁觸發事件函式的名稱。系統會在需要時自動呼叫這個函式,以建構 Gmail 首頁。您必須實作這個函式,才能建構並傳回單一 Card
或 Card
物件的陣列,這些物件會組成首頁。這個首頁觸發事件函式會將事件物件傳遞為參數,其中包含一些一般資訊,例如用戶端的平台。您可以使用事件物件資料,自訂首頁的結構。
查看可製作的內容
Google Workspace 外掛程式是使用 Apps Script 建構,其介面則是使用 Apps Script Card 服務定義。如需總覽,請參閱「建構 Google Workspace 外掛程式」。Google Workspace 外掛程式行為的設定會使用資訊清單,其中包含 Gmail 專屬的部分。
設定 Google Workspace 外掛程式來擴充 Gmail 時,您必須決定要為外掛程式建立哪些介面,以及外掛程式可執行的動作。如需詳細資訊,請參閱下列指南:
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-12-21 (世界標準時間)。
[null,null,["上次更新時間:2024-12-21 (世界標準時間)。"],[[["Google Workspace add-ons automate tasks within Gmail, saving users time and effort by providing interactive UI elements within emails."],["Add-ons enhance the Gmail experience by displaying extra information, connecting to external services, and letting users control add-on behavior."],["Developers can build custom add-ons with Apps Script and the Card service to extend Gmail's functionality on both desktop and mobile."],["Gmail add-ons can have homepages, contextual interfaces triggered by opening or composing emails, and the ability to create new drafts automatically."],["To learn more about building and configuring Gmail add-ons, explore the provided resources on extending UI, composing messages, manifests, and scopes."]]],["Google Workspace add-ons automate tasks within Gmail, saving users time. They enable interactive UIs when users read or compose messages, allowing actions like displaying information, connecting to external services, and controlling add-on behavior. Add-ons can create contextual interfaces for messages and compose actions, or automatically generate drafts. Developers can define homepages and other interfaces, customize them with event objects, and use Apps Script to build and configure these add-ons through manifests. They support both desktop and mobile Gmail clients.\n"]]