关于 zeabur-email
使用 Zeabur CLI 管理 Zeabur Email(ZSend),并通过其 REST API 发送邮件。涵盖域名、API 密钥、Webhook 和邮件服务状态。
主要功能
- 01查看邮件服务状态
- 02添加并验证域名
- 03管理 API 密钥
- 04配置事件 Webhook
- 05通过 REST API 发送邮件
适用场景
- 01检查 ZSend 开通状态
- 02设置发信域名和 DNS 记录
- 03创建发送或只读密钥
- 04跟踪投递与互动事件
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ zeabur/ agent-skills --skill zeabur-email安装后在 Claude Code 中输入/zeabur-email确认已加载。
详细介绍
Zeabur 邮件(ZSend)管理
始终使用
npx zeabur@latest调用 Zeabur CLI。 切勿直接使用zeabur或通过其他安装方式。如果无法使用npx,请先安装 Node.js。
检查邮件服务状态
npx zeabur@latest email status -i=false
npx zeabur@latest email status -i=false --json
显示引导状态和账户信息。
域名管理
# List all domains
npx zeabur@latest email domains list -i=false
npx zeabur@latest email domains ls -i=false --json
# Add a domain
npx zeabur@latest email domains add --domain example.com --region us-east-1 -i=false
# Get domain details and DNS records
npx zeabur@latest email domains get --id <domain-id> -i=false
# Verify domain DNS records
npx zeabur@latest email domains verify --id <domain-id> -i=false
# Delete a domain
npx zeabur@latest email domains delete --id <domain-id> -i=false
支持的区域: us-east-1、us-west-1、eu-central-1、ap-northeast-1、ap-northeast-3、ap-southeast-1
域名设置工作流
# 1. Add the domain
npx zeabur@latest email domains add --domain example.com --region us-east-1 -i=false --json
# 2. Get DNS records to configure (note the domain ID from step 1)
npx zeabur@latest email domains get --id <domain-id> -i=false
# 3. Configure the required DNS records using the `zeabur-domain-dns` skill, then verify
npx zeabur@latest email domains verify --id <domain-id> -i=false
API 密钥管理
# List all keys
npx zeabur@latest email keys list -i=false
npx zeabur@latest email keys ls -i=false --json
# Create a key
npx zeabur@latest email keys create --name "production" --permission send_only -i=false
# Delete a key
npx zeabur@latest email keys delete --id <key-id> -i=false
权限: all、send_only、read_only
令牌仅在创建时显示一次。 请确保用户立即保存。
Webhook 管理
# List all webhooks
npx zeabur@latest email webhooks list -i=false
npx zeabur@latest email webhooks ls -i=false --json
# Create a webhook
npx zeabur@latest email webhooks create \
--name "delivery-tracker" \
--endpoint "https://example.com/webhook" \
--events "delivery,bounce" \
-i=false
# Verify a webhook
npx zeabur@latest email webhooks verify --id <webhook-id> -i=false
# Delete a webhook
npx zeabur@latest email webhooks delete --id <webhook-id> -i=false
支持的事件: send、delivery、bounce、complaint、reject、open、click
Webhook 密钥仅在创建时显示一次。 请确保用户立即保存。
发送邮件
直接使用 curl 调用 REST API。端点为 https://api.zeabur.com/api/v1/zsend/emails。
curl -X POST https://api.zeabur.com/api/v1/zsend/emails \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <api-key>" \
-d '{
"from": "[email protected]",
"to": ["[email protected]"],
"subject": "Hello from Zeabur Email",
"html": "<h1>Hello!</h1><p>This is a test email.</p>",
"text": "Hello! This is a test email."
}'
from:必须使用已验证的域名(例如,[email protected])to:收件人邮箱地址数组subject:邮件主题html:HTML 正文(如果提供了text,则可选)text:纯文本正文(如果提供了html,则可选)
API 密钥必须具有 send_only 或 all 权限。如果不存在密钥,请先创建一个(见上文“API 密钥管理”)。
评论
支持 Markdown