postmark-automation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePostmark Automation via Rube MCP
通过Rube MCP实现Postmark自动化
Automate Postmark transactional email operations through Composio's Postmark toolkit via Rube MCP.
Toolkit docs: composio.dev/toolkits/postmark
通过Rube MCP,借助Composio的Postmark工具包自动化Postmark事务性邮件操作。
Prerequisites
前提条件
- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
- Active Postmark connection via with toolkit
RUBE_MANAGE_CONNECTIONSpostmark - Always call first to get current tool schemas
RUBE_SEARCH_TOOLS
- 必须已连接Rube MCP(需具备RUBE_SEARCH_TOOLS权限)
- 通过连接Postmark,且工具包为
RUBE_MANAGE_CONNECTIONS并处于激活状态postmark - 请始终先调用获取最新的工具架构
RUBE_SEARCH_TOOLS
Setup
设置步骤
Get Rube MCP: Add as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
https://rube.app/mcp- Verify Rube MCP is available by confirming responds
RUBE_SEARCH_TOOLS - Call with toolkit
RUBE_MANAGE_CONNECTIONSpostmark - If connection is not ACTIVE, follow the returned auth link to complete Postmark authentication
- Confirm connection status shows ACTIVE before running any workflows
获取Rube MCP:在客户端配置中添加作为MCP服务器。无需API密钥,只需添加端点即可使用。
https://rube.app/mcp- 通过确认能正常响应,验证Rube MCP是否可用
RUBE_SEARCH_TOOLS - 调用并指定工具包为
RUBE_MANAGE_CONNECTIONSpostmark - 如果连接未处于激活状态,请按照返回的授权链接完成Postmark认证
- 在运行任何工作流之前,确认连接状态显示为激活
Core Workflows
核心工作流
1. Send Templated Batch Emails
1. 发送批量模板化邮件
When to use: User wants to send templated emails to multiple recipients in one call
Tool sequence:
- - Find available templates and their IDs [Prerequisite]
POSTMARK_LIST_TEMPLATES - - Validate template with model data before sending [Optional]
POSTMARK_VALIDATE_TEMPLATE - - Send batch emails using a template [Required]
POSTMARK_SEND_BATCH_WITH_TEMPLATES
Key parameters:
- or
TemplateId: Identifier for the template to useTemplateAlias - : Array of message objects with
Messages,From,ToTemplateModel - : Key-value pairs matching template variables
TemplateModel
Pitfalls:
- Maximum 500 messages per batch call
- Either or
TemplateIdis required, not bothTemplateAlias - keys must match template variable names exactly (case-sensitive)
TemplateModel - Sender address must be a verified Sender Signature or from a verified domain
适用场景:用户需要一次性向多个收件人发送模板化邮件
工具调用序列:
- - 查找可用模板及其ID [前提步骤]
POSTMARK_LIST_TEMPLATES - - 发送前使用模型数据验证模板 [可选]
POSTMARK_VALIDATE_TEMPLATE - - 使用模板发送批量邮件 [必需]
POSTMARK_SEND_BATCH_WITH_TEMPLATES
关键参数:
- 或
TemplateId: 要使用的模板标识符TemplateAlias - : 包含
Messages、From、To的消息对象数组TemplateModel - : 与模板变量匹配的键值对
TemplateModel
注意事项:
- 每次批量调用最多支持500条消息
- 必须指定或
TemplateId中的一个,不可同时指定TemplateAlias - 的键必须与模板变量名完全匹配(区分大小写)
TemplateModel - 发件人地址必须是已验证的发件人签名,或来自已验证的域名
2. Manage Email Templates
2. 管理邮件模板
When to use: User wants to create, edit, or inspect email templates
Tool sequence:
- - List all templates with IDs and names [Required]
POSTMARK_LIST_TEMPLATES - - Get full template details including HTML/text body [Optional]
POSTMARK_GET_TEMPLATE - - Update template content or settings [Optional]
POSTMARK_EDIT_TEMPLATE - - Test template rendering with sample data [Optional]
POSTMARK_VALIDATE_TEMPLATE
Key parameters:
- : Numeric template ID for GET/EDIT operations
TemplateId - : Template display name
Name - : Email subject line (supports template variables)
Subject - : HTML content of the template
HtmlBody - : Plain text fallback content
TextBody - : 'Standard' or 'Layout'
TemplateType
Pitfalls:
- Template IDs are numeric integers, not strings
- Editing a template replaces the entire content; include all fields you want to keep
- Layout templates wrap Standard templates; changing a layout affects all linked templates
- Validate before sending to catch missing variables early
适用场景:用户需要创建、编辑或查看邮件模板
工具调用序列:
- - 列出所有模板的ID和名称 [必需]
POSTMARK_LIST_TEMPLATES - - 获取模板的完整详情,包括HTML/文本内容 [可选]
POSTMARK_GET_TEMPLATE - - 更新模板内容或设置 [可选]
POSTMARK_EDIT_TEMPLATE - - 使用示例数据测试模板渲染效果 [可选]
POSTMARK_VALIDATE_TEMPLATE
关键参数:
- : 用于GET/EDIT操作的数字模板ID
TemplateId - : 模板显示名称
Name - : 邮件主题行(支持模板变量)
Subject - : 模板的HTML内容
HtmlBody - : 纯文本备用内容
TextBody - : 'Standard'(标准)或 'Layout'(布局)
TemplateType
注意事项:
- 模板ID是数字整数,而非字符串
- 编辑模板会替换全部内容;请包含所有需要保留的字段
- 布局模板会包裹标准模板;修改布局会影响所有关联的标准模板
- 发送前请验证模板,尽早发现缺失的变量
3. Monitor Delivery Statistics
3. 监控交付统计数据
When to use: User wants to check email delivery health, open/click rates, or outbound overview
Tool sequence:
- - Get bounce counts by type [Required]
POSTMARK_GET_DELIVERY_STATS - - Get sent/opened/clicked/bounced summary [Required]
POSTMARK_GET_OUTBOUND_OVERVIEW - - Get tracked email volume over time [Optional]
POSTMARK_GET_TRACKED_EMAIL_COUNTS
Key parameters:
- : Start date for filtering stats (YYYY-MM-DD)
fromdate - : End date for filtering stats (YYYY-MM-DD)
todate - : Filter stats by message tag
tag - : Filter by message stream (e.g., 'outbound', 'broadcast')
messagestreamid
Pitfalls:
- Date parameters use YYYY-MM-DD format without time component
- Stats are aggregated; individual message tracking requires separate API calls
- defaults to all streams if not specified
messagestreamid
适用场景:用户需要检查邮件交付健康状况、打开/点击量,或外发邮件总览
工具调用序列:
- - 获取按类型分类的退信数量 [必需]
POSTMARK_GET_DELIVERY_STATS - - 获取已发送/已打开/已点击/已退信的汇总数据 [必需]
POSTMARK_GET_OUTBOUND_OVERVIEW - - 获取一段时间内的跟踪邮件量 [可选]
POSTMARK_GET_TRACKED_EMAIL_COUNTS
关键参数:
- : 统计数据的起始日期(格式:YYYY-MM-DD)
fromdate - : 统计数据的结束日期(格式:YYYY-MM-DD)
todate - : 按消息标签过滤统计数据
tag - : 按消息流过滤(例如:'outbound'、'broadcast')
messagestreamid
注意事项:
- 日期参数使用YYYY-MM-DD格式,不包含时间部分
- 统计数据为汇总值;单个消息的跟踪需要单独调用API
- 如果未指定,默认会包含所有消息流
messagestreamid
4. Manage Bounces and Complaints
4. 管理退信与投诉
When to use: User wants to review bounced emails or spam complaints
Tool sequence:
- - List bounced messages with details [Required]
POSTMARK_GET_BOUNCES - - List spam complaint records [Optional]
POSTMARK_GET_SPAM_COMPLAINTS - - Get bounce summary counts [Optional]
POSTMARK_GET_DELIVERY_STATS
Key parameters:
- : Number of records to return per page
count - : Pagination offset for results
offset - : Bounce type filter (e.g., 'HardBounce', 'SoftBounce', 'SpamNotification')
type - /
fromdate: Date range filterstodate - : Filter by recipient email address
emailFilter
Pitfalls:
- Bounce types include: HardBounce, SoftBounce, SpamNotification, SpamComplaint, Transient, and others
- Hard bounces indicate permanent delivery failures; these addresses should be removed
- Spam complaints affect sender reputation; monitor regularly
- Pagination uses and
count, not page tokensoffset
适用场景:用户需要查看退信邮件或垃圾邮件投诉记录
工具调用序列:
- - 列出包含详情的退信消息 [必需]
POSTMARK_GET_BOUNCES - - 列出垃圾邮件投诉记录 [可选]
POSTMARK_GET_SPAM_COMPLAINTS - - 获取退信汇总数量 [可选]
POSTMARK_GET_DELIVERY_STATS
关键参数:
- : 每页返回的记录数
count - : 结果的分页偏移量
offset - : 退信类型过滤器(例如:'HardBounce'、'SoftBounce'、'SpamNotification')
type - /
fromdate: 日期范围过滤器todate - : 按收件人邮箱地址过滤
emailFilter
注意事项:
- 退信类型包括:HardBounce(硬退信)、SoftBounce(软退信)、SpamNotification(垃圾邮件通知)、SpamComplaint(垃圾邮件投诉)、Transient(临时退信)等
- 硬退信表示永久交付失败;应移除这些收件人地址
- 垃圾邮件投诉会影响发件人信誉;请定期监控
- 分页使用和
count,而非页令牌offset
5. Configure Server Settings
5. 配置服务器设置
When to use: User wants to view or modify Postmark server configuration
Tool sequence:
- - Retrieve current server settings [Required]
POSTMARK_GET_SERVER - - Update server configuration [Optional]
POSTMARK_EDIT_SERVER
Key parameters:
- : Server display name
Name - : Enable/disable SMTP API access
SmtpApiActivated - : Webhook URL for bounce notifications
BounceHookUrl - : Webhook URL for inbound email processing
InboundHookUrl - : Enable/disable open tracking
TrackOpens - : Link tracking mode ('None', 'HtmlAndText', 'HtmlOnly', 'TextOnly')
TrackLinks
Pitfalls:
- Server edits affect all messages sent through that server
- Webhook URLs must be publicly accessible HTTPS endpoints
- Changing affects SMTP relay access immediately
SmtpApiActivated - Track settings apply to future messages only, not retroactively
适用场景:用户需要查看或修改Postmark服务器配置
工具调用序列:
- - 获取当前服务器设置 [必需]
POSTMARK_GET_SERVER - - 更新服务器配置 [可选]
POSTMARK_EDIT_SERVER
关键参数:
- : 服务器显示名称
Name - : 启用/禁用SMTP API访问
SmtpApiActivated - : 退信通知的Webhook URL
BounceHookUrl - : 入站邮件处理的Webhook URL
InboundHookUrl - : 启用/禁用打开跟踪
TrackOpens - : 链接跟踪模式('None'、'HtmlAndText'、'HtmlOnly'、'TextOnly')
TrackLinks
注意事项:
- 服务器配置的修改会影响通过该服务器发送的所有消息
- Webhook URL必须是可公开访问的HTTPS端点
- 修改会立即影响SMTP中继访问
SmtpApiActivated - 跟踪设置仅对未来的消息生效,不追溯过往消息
Common Patterns
常见模式
Template Variable Resolution
模板变量解析
1. Call POSTMARK_GET_TEMPLATE with TemplateId
2. Inspect HtmlBody/TextBody for {{variable}} placeholders
3. Build TemplateModel dict with matching keys
4. Call POSTMARK_VALIDATE_TEMPLATE to verify rendering1. 使用TemplateId调用POSTMARK_GET_TEMPLATE
2. 检查HtmlBody/TextBody中的{{variable}}占位符
3. 构建包含匹配键的TemplateModel字典
4. 调用POSTMARK_VALIDATE_TEMPLATE验证渲染效果Pagination
分页处理
- Set for results per page (varies by endpoint)
count - Use to skip previously fetched results
offset - Increment offset by count each page until results returned < count
- Total records may be returned in response metadata
- 设置指定每页结果数(因端点而异)
count - 使用跳过已获取的结果
offset - 每次分页将offset增加count,直到返回的结果数小于count
- 总记录数可能会在响应元数据中返回
Known Pitfalls
已知注意事项
Authentication:
- Postmark uses server-level API tokens, not account-level
- Each server has its own token; ensure correct server context
- Sender addresses must be verified Sender Signatures or from verified domains
Rate Limits:
- Batch send limited to 500 messages per call
- API rate limits vary by endpoint; implement backoff on 429 responses
Response Parsing:
- Response data may be nested under or
datadata.data - Parse defensively with fallback patterns
- Template IDs are always numeric integers
认证:
- Postmark使用服务器级API令牌,而非账户级令牌
- 每个服务器都有独立的令牌;请确保使用正确的服务器上下文
- 发件人地址必须是已验证的发件人签名,或来自已验证的域名
速率限制:
- 批量发送每次调用最多500条消息
- 不同端点的API速率限制不同;收到429响应时请实现退避机制
响应解析:
- 响应数据可能嵌套在或
data下data.data - 请使用防御性解析并设置回退模式
- 模板ID始终为数字整数
Quick Reference
快速参考
| Task | Tool Slug | Key Params |
|---|---|---|
| Send batch templated emails | POSTMARK_SEND_BATCH_WITH_TEMPLATES | Messages, TemplateId/TemplateAlias |
| List templates | POSTMARK_LIST_TEMPLATES | Count, Offset, TemplateType |
| Get template details | POSTMARK_GET_TEMPLATE | TemplateId |
| Edit template | POSTMARK_EDIT_TEMPLATE | TemplateId, Name, Subject, HtmlBody |
| Validate template | POSTMARK_VALIDATE_TEMPLATE | TemplateId, TemplateModel |
| Delivery stats | POSTMARK_GET_DELIVERY_STATS | (none or date filters) |
| Outbound overview | POSTMARK_GET_OUTBOUND_OVERVIEW | fromdate, todate, tag |
| Get bounces | POSTMARK_GET_BOUNCES | count, offset, type, emailFilter |
| Get spam complaints | POSTMARK_GET_SPAM_COMPLAINTS | count, offset, fromdate, todate |
| Tracked email counts | POSTMARK_GET_TRACKED_EMAIL_COUNTS | fromdate, todate, tag |
| Get server config | POSTMARK_GET_SERVER | (none) |
| Edit server config | POSTMARK_EDIT_SERVER | Name, TrackOpens, TrackLinks |
Powered by Composio
| 任务 | 工具标识 | 关键参数 |
|---|---|---|
| 发送批量模板化邮件 | POSTMARK_SEND_BATCH_WITH_TEMPLATES | Messages, TemplateId/TemplateAlias |
| 列出模板 | POSTMARK_LIST_TEMPLATES | Count, Offset, TemplateType |
| 获取模板详情 | POSTMARK_GET_TEMPLATE | TemplateId |
| 编辑模板 | POSTMARK_EDIT_TEMPLATE | TemplateId, Name, Subject, HtmlBody |
| 验证模板 | POSTMARK_VALIDATE_TEMPLATE | TemplateId, TemplateModel |
| 交付统计数据 | POSTMARK_GET_DELIVERY_STATS | (无或日期过滤器) |
| 外发邮件总览 | POSTMARK_GET_OUTBOUND_OVERVIEW | fromdate, todate, tag |
| 获取退信记录 | POSTMARK_GET_BOUNCES | count, offset, type, emailFilter |
| 获取垃圾邮件投诉 | POSTMARK_GET_SPAM_COMPLAINTS | count, offset, fromdate, todate |
| 跟踪邮件数量 | POSTMARK_GET_TRACKED_EMAIL_COUNTS | fromdate, todate, tag |
| 获取服务器配置 | POSTMARK_GET_SERVER | (无) |
| 编辑服务器配置 | POSTMARK_EDIT_SERVER | Name, TrackOpens, TrackLinks |
由 Composio 提供支持