# 设置 Power Automate 以使用 discourse-chat-integration 插件发送 Microsoft Teams 通知

**URL:** <https://meta.discourse.org/t/set-up-power-automate-to-send-microsoft-teams-notifications-using-the-discourse-chat-integration-plugin/322340>\
**Category:** Administrators\
**Tags:** chat-integration\
**Created:** [2024 年8 月 19 日 21:36 UTC](https://meta.discourse.org/t/set-up-power-automate-to-send-microsoft-teams-notifications-using-the-discourse-chat-integration-plugin/322340 "2024-08-19T21:36:01Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![crossheadscrewdriver](https://avatars.discourse-cdn.com/v4/letter/c/7c8e57/32.png) [@crossheadscrewdriver](https://meta.discourse.org/u/crossheadscrewdriver)\
发布日期： [2024 年8 月 19 日 21:36 UTC](https://meta.discourse.org/t/set-up-power-automate-to-send-microsoft-teams-notifications-using-the-discourse-chat-integration-plugin/322340/1 "2024-08-19T21:36:01Z")

</div>

此 #howto 描述了如何设置 `discourse-chat-integration` 中包含的 Power Automate 提供程序。

# 安装

如果尚未安装，请安装 [discourse-chat-integration](https://meta.discourse.org/t/chatroom-integration-plugin-discourse-chat-integration/66522)插件。

# 设置 Microsoft Teams

Power Automate 使用的网络钩子可以直接从 Power Automate 或通过 Microsoft Teams 创建。您必须为要发送更新到的每个 Microsoft Teams 频道执行其中一个步骤。

## 通过 Microsoft Teams 设置（简单快捷）

1. 导航到要添加网络钩子的频道或聊天，然后从顶部导航栏中选择（•••）_更多选项_。
2. 从下拉菜单中选择 **工作流** ，然后搜索 **收到网络钩子请求时发布到频道** 。
3. 提供一个名称和将用于发布的帐户，然后单击 **下一步** 。验证提供的团队和频道（或聊天），然后单击 **添加工作流** 。
4. 对话窗口将显示一个映射到频道的唯一 URL。确保您 **复制并保存 URL** — 您必须将其提供给外部服务。
5. 选择 **完成** 按钮。网络钩子将在团队频道中可用。

## 通过 Power Automate 设置（高级且可自定义）

从预建模板开始：

- [收到网络钩子请求时发布到频道](https://make.preview.powerautomate.com/galleries/public/templates/d271a6f01c2545a28348d8f2cddf4c8f/post-to-a-channel-when-a-webhook-request-is-received)
- [收到网络钩子请求时发布到聊天](https://make.preview.powerautomate.com/galleries/public/templates/34ac6c11796143e1807d6e16c4c28050/post-to-a-chat-when-a-webhook-request-is-received)

1. 如果尚未登录，请登录 Power Automate。
2. 选择要连接的 Microsoft Teams 用户帐户。该帐户将显示为从此自动化发送的通知的发件人。
3. 选择 Microsoft Teams 团队和频道（或聊天）。
4. 单击“在高级模式下编辑”链接。
5. 在新视图中，单击标题并将其更新为更有意义的内容，单击“保存”，然后单击“收到 Teams 网络钩子请求时”卡片。
6. 对话窗格将显示一个映射到频道（或聊天）的唯一 URL。确保您 **复制并保存 URL** — 您必须将其提供给外部服务。

# 设置 Discourse

1. 在您的站点设置中，启用“启用了聊天集成团队”设置。
2. 转到“插件”选项卡，然后转到“聊天集成”。
3. 转到“Power Automate”选项卡，然后单击“添加频道”。
4. 输入您的团队频道的名称（例如，discourse）。
5. 粘贴您之前复制的网络钩子 URL，然后单击“保存频道”。
6. 使用您刚刚创建的频道的“测试”按钮来检查一切是否正常。您应该会在 Microsoft Teams 频道中看到您的测试主题。
7. 根据 [discourse-chat-integration](https://meta.discourse.org/t/chatroom-integration-plugin-discourse-chat-integration/66522) 说明为您的频道设置一些规则。
8. 庆祝 🎉

---

_[View the full topic](https://meta.discourse.org/t/set-up-power-automate-to-send-microsoft-teams-notifications-using-the-discourse-chat-integration-plugin/322340)._
