postmark-automation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Postmark Automation via Rube MCP

通过Rube MCP实现Postmark自动化

Automate Postmark transactional email operations through Composio's Postmark toolkit via Rube MCP.
通过Rube MCP,借助Composio的Postmark工具包自动化Postmark事务性邮件操作。

Prerequisites

前提条件

  • Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
  • Active Postmark connection via
    RUBE_MANAGE_CONNECTIONS
    with toolkit
    postmark
  • Always call
    RUBE_SEARCH_TOOLS
    first to get current tool schemas
  • 必须已连接Rube MCP(需具备RUBE_SEARCH_TOOLS权限)
  • 通过
    RUBE_MANAGE_CONNECTIONS
    连接Postmark,且工具包为
    postmark
    并处于激活状态
  • 请始终先调用
    RUBE_SEARCH_TOOLS
    获取最新的工具架构

Setup

设置步骤

Get Rube MCP: Add
https://rube.app/mcp
as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
  1. Verify Rube MCP is available by confirming
    RUBE_SEARCH_TOOLS
    responds
  2. Call
    RUBE_MANAGE_CONNECTIONS
    with toolkit
    postmark
  3. If connection is not ACTIVE, follow the returned auth link to complete Postmark authentication
  4. Confirm connection status shows ACTIVE before running any workflows
获取Rube MCP:在客户端配置中添加
https://rube.app/mcp
作为MCP服务器。无需API密钥,只需添加端点即可使用。
  1. 通过确认
    RUBE_SEARCH_TOOLS
    能正常响应,验证Rube MCP是否可用
  2. 调用
    RUBE_MANAGE_CONNECTIONS
    并指定工具包为
    postmark
  3. 如果连接未处于激活状态,请按照返回的授权链接完成Postmark认证
  4. 在运行任何工作流之前,确认连接状态显示为激活

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:
  1. POSTMARK_LIST_TEMPLATES
    - Find available templates and their IDs [Prerequisite]
  2. POSTMARK_VALIDATE_TEMPLATE
    - Validate template with model data before sending [Optional]
  3. POSTMARK_SEND_BATCH_WITH_TEMPLATES
    - Send batch emails using a template [Required]
Key parameters:
  • TemplateId
    or
    TemplateAlias
    : Identifier for the template to use
  • Messages
    : Array of message objects with
    From
    ,
    To
    ,
    TemplateModel
  • TemplateModel
    : Key-value pairs matching template variables
Pitfalls:
  • Maximum 500 messages per batch call
  • Either
    TemplateId
    or
    TemplateAlias
    is required, not both
  • TemplateModel
    keys must match template variable names exactly (case-sensitive)
  • Sender address must be a verified Sender Signature or from a verified domain
适用场景:用户需要一次性向多个收件人发送模板化邮件
工具调用序列:
  1. POSTMARK_LIST_TEMPLATES
    - 查找可用模板及其ID [前提步骤]
  2. POSTMARK_VALIDATE_TEMPLATE
    - 发送前使用模型数据验证模板 [可选]
  3. 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:
  1. POSTMARK_LIST_TEMPLATES
    - List all templates with IDs and names [Required]
  2. POSTMARK_GET_TEMPLATE
    - Get full template details including HTML/text body [Optional]
  3. POSTMARK_EDIT_TEMPLATE
    - Update template content or settings [Optional]
  4. POSTMARK_VALIDATE_TEMPLATE
    - Test template rendering with sample data [Optional]
Key parameters:
  • TemplateId
    : Numeric template ID for GET/EDIT operations
  • Name
    : Template display name
  • Subject
    : Email subject line (supports template variables)
  • HtmlBody
    : HTML content of the template
  • TextBody
    : Plain text fallback content
  • TemplateType
    : 'Standard' or 'Layout'
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
适用场景:用户需要创建、编辑或查看邮件模板
工具调用序列:
  1. POSTMARK_LIST_TEMPLATES
    - 列出所有模板的ID和名称 [必需]
  2. POSTMARK_GET_TEMPLATE
    - 获取模板的完整详情,包括HTML/文本内容 [可选]
  3. POSTMARK_EDIT_TEMPLATE
    - 更新模板内容或设置 [可选]
  4. POSTMARK_VALIDATE_TEMPLATE
    - 使用示例数据测试模板渲染效果 [可选]
关键参数:
  • TemplateId
    : 用于GET/EDIT操作的数字模板ID
  • Name
    : 模板显示名称
  • Subject
    : 邮件主题行(支持模板变量)
  • HtmlBody
    : 模板的HTML内容
  • TextBody
    : 纯文本备用内容
  • TemplateType
    : 'Standard'(标准)或 'Layout'(布局)
注意事项:
  • 模板ID是数字整数,而非字符串
  • 编辑模板会替换全部内容;请包含所有需要保留的字段
  • 布局模板会包裹标准模板;修改布局会影响所有关联的标准模板
  • 发送前请验证模板,尽早发现缺失的变量

3. Monitor Delivery Statistics

3. 监控交付统计数据

When to use: User wants to check email delivery health, open/click rates, or outbound overview
Tool sequence:
  1. POSTMARK_GET_DELIVERY_STATS
    - Get bounce counts by type [Required]
  2. POSTMARK_GET_OUTBOUND_OVERVIEW
    - Get sent/opened/clicked/bounced summary [Required]
  3. POSTMARK_GET_TRACKED_EMAIL_COUNTS
    - Get tracked email volume over time [Optional]
Key parameters:
  • fromdate
    : Start date for filtering stats (YYYY-MM-DD)
  • todate
    : End date for filtering stats (YYYY-MM-DD)
  • tag
    : Filter stats by message tag
  • messagestreamid
    : Filter by message stream (e.g., 'outbound', 'broadcast')
Pitfalls:
  • Date parameters use YYYY-MM-DD format without time component
  • Stats are aggregated; individual message tracking requires separate API calls
  • messagestreamid
    defaults to all streams if not specified
适用场景:用户需要检查邮件交付健康状况、打开/点击量,或外发邮件总览
工具调用序列:
  1. POSTMARK_GET_DELIVERY_STATS
    - 获取按类型分类的退信数量 [必需]
  2. POSTMARK_GET_OUTBOUND_OVERVIEW
    - 获取已发送/已打开/已点击/已退信的汇总数据 [必需]
  3. POSTMARK_GET_TRACKED_EMAIL_COUNTS
    - 获取一段时间内的跟踪邮件量 [可选]
关键参数:
  • fromdate
    : 统计数据的起始日期(格式:YYYY-MM-DD)
  • todate
    : 统计数据的结束日期(格式:YYYY-MM-DD)
  • tag
    : 按消息标签过滤统计数据
  • messagestreamid
    : 按消息流过滤(例如:'outbound'、'broadcast')
注意事项:
  • 日期参数使用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:
  1. POSTMARK_GET_BOUNCES
    - List bounced messages with details [Required]
  2. POSTMARK_GET_SPAM_COMPLAINTS
    - List spam complaint records [Optional]
  3. POSTMARK_GET_DELIVERY_STATS
    - Get bounce summary counts [Optional]
Key parameters:
  • count
    : Number of records to return per page
  • offset
    : Pagination offset for results
  • type
    : Bounce type filter (e.g., 'HardBounce', 'SoftBounce', 'SpamNotification')
  • fromdate
    /
    todate
    : Date range filters
  • emailFilter
    : Filter by recipient email address
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
    count
    and
    offset
    , not page tokens
适用场景:用户需要查看退信邮件或垃圾邮件投诉记录
工具调用序列:
  1. POSTMARK_GET_BOUNCES
    - 列出包含详情的退信消息 [必需]
  2. POSTMARK_GET_SPAM_COMPLAINTS
    - 列出垃圾邮件投诉记录 [可选]
  3. POSTMARK_GET_DELIVERY_STATS
    - 获取退信汇总数量 [可选]
关键参数:
  • count
    : 每页返回的记录数
  • offset
    : 结果的分页偏移量
  • type
    : 退信类型过滤器(例如:'HardBounce'、'SoftBounce'、'SpamNotification')
  • 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:
  1. POSTMARK_GET_SERVER
    - Retrieve current server settings [Required]
  2. POSTMARK_EDIT_SERVER
    - Update server configuration [Optional]
Key parameters:
  • Name
    : Server display name
  • SmtpApiActivated
    : Enable/disable SMTP API access
  • BounceHookUrl
    : Webhook URL for bounce notifications
  • InboundHookUrl
    : Webhook URL for inbound email processing
  • TrackOpens
    : Enable/disable open tracking
  • TrackLinks
    : Link tracking mode ('None', 'HtmlAndText', 'HtmlOnly', 'TextOnly')
Pitfalls:
  • Server edits affect all messages sent through that server
  • Webhook URLs must be publicly accessible HTTPS endpoints
  • Changing
    SmtpApiActivated
    affects SMTP relay access immediately
  • Track settings apply to future messages only, not retroactively
适用场景:用户需要查看或修改Postmark服务器配置
工具调用序列:
  1. POSTMARK_GET_SERVER
    - 获取当前服务器设置 [必需]
  2. POSTMARK_EDIT_SERVER
    - 更新服务器配置 [可选]
关键参数:
  • Name
    : 服务器显示名称
  • SmtpApiActivated
    : 启用/禁用SMTP API访问
  • BounceHookUrl
    : 退信通知的Webhook URL
  • InboundHookUrl
    : 入站邮件处理的Webhook URL
  • TrackOpens
    : 启用/禁用打开跟踪
  • TrackLinks
    : 链接跟踪模式('None'、'HtmlAndText'、'HtmlOnly'、'TextOnly')
注意事项:
  • 服务器配置的修改会影响通过该服务器发送的所有消息
  • Webhook URL必须是可公开访问的HTTPS端点
  • 修改
    SmtpApiActivated
    会立即影响SMTP中继访问
  • 跟踪设置仅对未来的消息生效,不追溯过往消息

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 rendering
1. 使用TemplateId调用POSTMARK_GET_TEMPLATE
2. 检查HtmlBody/TextBody中的{{variable}}占位符
3. 构建包含匹配键的TemplateModel字典
4. 调用POSTMARK_VALIDATE_TEMPLATE验证渲染效果

Pagination

分页处理

  • Set
    count
    for results per page (varies by endpoint)
  • Use
    offset
    to skip previously fetched results
  • 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
    data
    or
    data.data
  • Parse defensively with fallback patterns
  • Template IDs are always numeric integers
认证:
  • Postmark使用服务器级API令牌,而非账户级令牌
  • 每个服务器都有独立的令牌;请确保使用正确的服务器上下文
  • 发件人地址必须是已验证的发件人签名,或来自已验证的域名
速率限制:
  • 批量发送每次调用最多500条消息
  • 不同端点的API速率限制不同;收到429响应时请实现退避机制
响应解析:
  • 响应数据可能嵌套在
    data
    data.data
  • 请使用防御性解析并设置回退模式
  • 模板ID始终为数字整数

Quick Reference

快速参考

TaskTool SlugKey Params
Send batch templated emailsPOSTMARK_SEND_BATCH_WITH_TEMPLATESMessages, TemplateId/TemplateAlias
List templatesPOSTMARK_LIST_TEMPLATESCount, Offset, TemplateType
Get template detailsPOSTMARK_GET_TEMPLATETemplateId
Edit templatePOSTMARK_EDIT_TEMPLATETemplateId, Name, Subject, HtmlBody
Validate templatePOSTMARK_VALIDATE_TEMPLATETemplateId, TemplateModel
Delivery statsPOSTMARK_GET_DELIVERY_STATS(none or date filters)
Outbound overviewPOSTMARK_GET_OUTBOUND_OVERVIEWfromdate, todate, tag
Get bouncesPOSTMARK_GET_BOUNCEScount, offset, type, emailFilter
Get spam complaintsPOSTMARK_GET_SPAM_COMPLAINTScount, offset, fromdate, todate
Tracked email countsPOSTMARK_GET_TRACKED_EMAIL_COUNTSfromdate, todate, tag
Get server configPOSTMARK_GET_SERVER(none)
Edit server configPOSTMARK_EDIT_SERVERName, TrackOpens, TrackLinks

Powered by Composio
任务工具标识关键参数
发送批量模板化邮件POSTMARK_SEND_BATCH_WITH_TEMPLATESMessages, TemplateId/TemplateAlias
列出模板POSTMARK_LIST_TEMPLATESCount, Offset, TemplateType
获取模板详情POSTMARK_GET_TEMPLATETemplateId
编辑模板POSTMARK_EDIT_TEMPLATETemplateId, Name, Subject, HtmlBody
验证模板POSTMARK_VALIDATE_TEMPLATETemplateId, TemplateModel
交付统计数据POSTMARK_GET_DELIVERY_STATS(无或日期过滤器)
外发邮件总览POSTMARK_GET_OUTBOUND_OVERVIEWfromdate, todate, tag
获取退信记录POSTMARK_GET_BOUNCEScount, offset, type, emailFilter
获取垃圾邮件投诉POSTMARK_GET_SPAM_COMPLAINTScount, offset, fromdate, todate
跟踪邮件数量POSTMARK_GET_TRACKED_EMAIL_COUNTSfromdate, todate, tag
获取服务器配置POSTMARK_GET_SERVER(无)
编辑服务器配置POSTMARK_EDIT_SERVERName, TrackOpens, TrackLinks

Composio 提供支持