邮件消息事件
Email Message Event 记录某封邮件的投递状态变化,帮助你观察完整邮件生命周期。
Schema
interface EmailMessageEvent {
id: string; // "eme_..." - Unique identifier
account_id: string; // Owning account
email_message_id: string; // Associated message
event_type: string; // Event type
meta: Record<string, any> | null; // Additional data
occurred_at: string; // ISO 8601 timestamp
}
属性
| 属性 | 类型 | 说明 |
|---|---|---|
id | string | 带 eme_ 前缀的 KSUID |
account_id | string | 所属账户上下文 |
email_message_id | string | 关联的邮件消息 ID |
event_type | string | 事件类型 |
meta | object? | 事件特定元数据 |
occurred_at | string | 事件发生时间 |
事件类型
事件类型由服务商定义,常见值包括:
| 类型 | 说明 |
|---|---|
queued | 消息已接受,等待投递 |
sent | 已交给接收方 MTA |
delivered | 已确认送达收件箱 |
bounced | 永久投递失败 |
soft_bounced | 临时投递失败 |
complained | 收件人标记为垃圾邮件 |
opened | 收件人已打开邮件 |
clicked | 收件人已点击链接 |
事件流
示例
{
"id": "eme_2kHfPZcN9xW4mE8RtY7vB",
"account_id": "acc_1jGePYbM8wV3lD7QsX6uA",
"email_message_id": "eml_3lIfQZdO0yX5nF9SuY8wC",
"event_type": "delivered",
"meta": {
"recipient": "user@example.com",
"smtp_response": "250 OK"
},
"occurred_at": "2025-01-15T10:30:45Z"
}
相关
- Email Message - 消息记录
- 邮件 - 邮件基础设施