使用 Google Workspace 插件扩展 Gmail 的功能
许多电子邮件的目的是让收件人执行特定任务或达成目标,例如添加日历活动、填写表单、进行预订或使用其他应用。不过,收件人必须在没有任何进一步提示的情况下完成任务,通常需要执行一系列手动步骤。
您可以使用 Google Workspace 插件自动执行这些任务,从而为用户节省时间和精力。当用户在 Gmail 中阅读或撰写邮件时,Google Workspace 插件可以显示交互式自定义界面,让用户能够通过多种方式处理邮件,例如:
- 在 Gmail 界面中向用户显示其他信息。
- 连接到非 Google 服务,以检索信息或执行其他操作。
- 提供用于控制插件行为或向其他服务发送信息的方法。
Google Workspace 插件可以在 Gmail 中定义以下类型的扩展程序:
此外,用于扩展 Gmail 的 Google Workspace 插件可在桌面版和移动版客户端上使用。
Gmail 首页
Gmail 支持显示 Google Workspace 插件首页。如需在 Gmail 中显示您的插件通用首页,只需确保该插件的清单中包含 addOns.gmail
字段即可。
或者,您也可以向插件清单添加 gmail.homepageTrigger
,以提供 Gmail 专用首页。
无论是哪种情况,您都必须在插件脚本项目中提供首页触发器函数的名称。系统会在需要时自动调用此函数来构建 Gmail 首页。您必须实现此函数,以构建并返回一个 Card
或一个由 Card
对象组成的首页数组。系统会将事件对象作为参数传递给首页触发器函数,其中包含一些常规信息,例如客户端的平台。您可以使用事件对象数据来量身定制首页的构建方式。
查看您可以制作的内容
Google Workspace 插件是使用 Apps 脚本构建的,其接口是使用 Apps 脚本卡片服务定义的。如需大致了解,请参阅构建 Google Workspace 插件。Google Workspace 插件行为是使用清单进行配置的,其中包含 Gmail 专用部分。
在配置 Google Workspace 插件以扩展 Gmail 时,您必须决定要为插件创建哪些接口,以及该插件可以执行哪些操作。如需了解详情,请参阅以下指南:
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-12-21。
[null,null,["最后更新时间 (UTC):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"]]