> For the complete documentation index, see [llms.txt](https://help.sesami.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sesami.co/zh-cn/zi-dong-hua/email-and-webhook-as-action-types.md).

# 电子邮件和 Webhook 作为操作类型

Sesami Flows 支持两种主要操作类型，可自动化你的预订工作流： **电子邮件** 和 **Webhook**.

## 电子邮件操作

电子邮件操作可让你基于预订事件发送自定义品牌通知。

### 何时使用电子邮件操作

* 发送带有特定品牌标识的自定义确认邮件
* 创建按服务或地点划分的电子邮件模板
* 根据预订条件（语言、服务类型等）发送不同邮件
* 向团队成员或客户发送自定义消息通知

### 电子邮件操作如何工作

1. 发生预订事件（创建、更新或取消）
2. 你的 Flow 会检查你定义的条件
3. 如果条件匹配，电子邮件将发送给指定的收件人

### 电子邮件操作功能

* **自定义内容**：编写你自己的主题行和邮件正文
* **条件分支**：根据服务、地点或语言发送不同邮件
* **动态变量**：包含预订详情，如日期、时间、客户姓名、服务名称
* **多个收件人**：发送给客户、商家或团队成员

{% hint style="warning" %}
**重要限制**：通过 Flows 发送的电子邮件操作 **不** 支持 `.ics` 日历文件附件。如果你需要日历文件，请改用 Sesami 的默认通知邮件。
{% endhint %}

### 示例用例

* 向法语客户发送法语欢迎邮件
* 为特定服务发送专门的预约前说明
* 在高价值预订创建时通知经理
* 在预约完成后发送跟进邮件

## Webhook 操作

Webhook 操作通过 HTTP POST 请求实时向外部系统发送预订数据。

### 何时使用 Webhook 操作

* 与第三方营销平台集成（Klaviyo、Omnisend 等）
* 在你自己的系统中触发自定义业务逻辑
* 将预订数据发送到分析或 CRM 平台
* 连接 Zapier 或 Make（原 Integromat）以实现扩展自动化

### Webhook 操作如何工作

1. 发生预订事件（创建、更新或取消）
2. 你的 Flow 会检查你定义的条件
3. 如果条件匹配，Sesami 会向你的 webhook URL 发送 HTTP POST 请求
4. 接收系统处理预订数据

### Webhook 负载

Webhook 以 JSON 格式发送预订数据，包括：

* 预订详情（日期、时间、时长）
* 客户信息（姓名、电子邮件、电话）
* 服务和资源详情
* 预订状态（已确认、已取消、已改期）
* 自定义字段和元数据

### 示例用例

* 将预订数据发送到 Klaviyo 以实现营销自动化
* 通过 Twilio 或类似服务触发短信提醒
* 在创建预订时更新你的内部 CRM
* 将预订分析数据发送到 Google Analytics 或 Mixpanel
* 在服务被预订时，在项目管理工具中创建任务

## 比较电子邮件与 Webhook 操作

| 功能       | 电子邮件操作     | Webhook 操作    |
| -------- | ---------- | ------------- |
| **主要用途** | 发送通知       | 将数据发送到外部系统    |
| **接收方**  | 电子邮件地址     | HTTP 端点 URL   |
| **内容**   | HTML 电子邮件  | JSON 数据载荷     |
| **日历文件** | 不支持        | 不适用           |
| **自定义**  | 主题、正文、品牌标识 | JSON 中的完整预订数据 |
| **最适合**  | 客户/团队通知    | 系统集成          |

## 在 Flows 中设置操作

要向你的 Flow 添加电子邮件或 Webhook 操作：

1. 打开 [Sesami 管理门户](https://help.sesami.co/admin/sesami-admin-portal)
2. 前往 **Flows**
3. 创建新的 Flow 或编辑现有 Flow
4. 选择你的触发事件（预约创建、改期、客户签到、预约开始、取消或未到场）以及它应在何时运行
5. 如有需要，添加条件（可选）
6. 添加一个 **电子邮件** 或 **Webhook** 操作
7. 配置操作详情
8. **保存** 并测试你的 Flow

{% hint style="info" %}
**专业提示**：在为真实客户启用 Flow 之前，务必先用测试预订进行测试。检查电子邮件是否正确送达，或 webhook 数据是否被正确接收。
{% endhint %}

## 故障排除

<details>

<summary>Webhook 未收到数据</summary>

* 确认你的 webhook URL 正确且可公开访问
* 检查你的端点是否接受 POST 请求
* 确保你的服务器返回 200 OK 状态码
* 检查你的 Flow 条件，确保它们已被满足
* 检查 Sesami Flow 日志中的送达状态

</details>

<details>

<summary>电子邮件未发送</summary>

* 确认电子邮件地址配置正确
* 检查你的 Flow 条件是否已满足
* 确保 Flow 已启用并处于活动状态
* 用一个简单的预订进行测试，验证触发器是否正常工作
* 如果使用你自己的电子邮件进行测试，请检查垃圾邮件文件夹

</details>

## 相关内容

* [Sesami Flows](https://help.sesami.co/zh-cn/zi-dong-hua/sesami-flows.md) - 自动化系统概览
* [Sesami Flows 和 Klaviyo](https://help.sesami.co/zh-cn/zi-dong-hua/sesami-flows-and-klaviyo.md) - 与 Klaviyo 集成
* [Sesami Flows 和 Omnisend](https://help.sesami.co/zh-cn/zi-dong-hua/sesami-flows-and-omnisend.md) - 与 Omnisend 集成
* [通知邮件](https://help.sesami.co/zh-cn/tong-zhi/notification-emails.md) - 默认通知系统


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.sesami.co/zh-cn/zi-dong-hua/email-and-webhook-as-action-types.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
