brevo-automation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Brevo Automation via Rube MCP

通过Rube MCP实现Brevo自动化

Automate Brevo (formerly Sendinblue) email marketing operations through Composio's Brevo toolkit via Rube MCP.
通过Composio的Brevo工具包,借助Rube MCP自动化Brevo(原Sendinblue)的电子邮件营销操作。

Prerequisites

前提条件

  • Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
  • Active Brevo connection via
    RUBE_MANAGE_CONNECTIONS
    with toolkit
    brevo
  • Always call
    RUBE_SEARCH_TOOLS
    first to get current tool schemas
  • 必须已连接Rube MCP(需确保RUBE_SEARCH_TOOLS可用)
  • 通过
    RUBE_MANAGE_CONNECTIONS
    并使用工具包
    brevo
    建立有效的Brevo连接
  • 请始终先调用
    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
    brevo
  3. If connection is not ACTIVE, follow the returned auth link to complete Brevo 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
    并指定工具包
    brevo
  3. 如果连接状态不是ACTIVE,请按照返回的认证链接完成Brevo认证
  4. 在运行任何工作流之前,确认连接状态显示为ACTIVE

Core Workflows

核心工作流

1. Manage Email Campaigns

1. 管理电子邮件营销活动

When to use: User wants to list, review, or update email campaigns
Tool sequence:
  1. BREVO_LIST_EMAIL_CAMPAIGNS
    - List all campaigns with filters [Required]
  2. BREVO_UPDATE_EMAIL_CAMPAIGN
    - Update campaign content or settings [Optional]
Key parameters for listing:
  • type
    : Campaign type ('classic' or 'trigger')
  • status
    : Campaign status ('suspended', 'archive', 'sent', 'queued', 'draft', 'inProcess', 'inReview')
  • startDate
    /
    endDate
    : Date range filter (YYYY-MM-DDTHH:mm:ss.SSSZ format)
  • statistics
    : Stats type to include ('globalStats', 'linksStats', 'statsByDomain')
  • limit
    : Results per page (max 100, default 50)
  • offset
    : Pagination offset
  • sort
    : Sort order ('asc' or 'desc')
  • excludeHtmlContent
    : Set
    true
    to reduce response size
Key parameters for update:
  • campaign_id
    : Numeric campaign ID (required)
  • name
    : Campaign name
  • subject
    : Email subject line
  • htmlContent
    : HTML email body (mutually exclusive with
    htmlUrl
    )
  • htmlUrl
    : URL to HTML content
  • sender
    : Sender object with
    name
    ,
    email
    , or
    id
  • recipients
    : Object with
    listIds
    and
    exclusionListIds
  • scheduledAt
    : Scheduled send time (YYYY-MM-DDTHH:mm:ss.SSSZ)
Pitfalls:
  • startDate
    and
    endDate
    are mutually required; provide both or neither
  • Date filters only work when
    status
    is not passed or set to 'sent'
  • htmlContent
    and
    htmlUrl
    are mutually exclusive
  • Campaign
    sender
    email must be a verified sender in Brevo
  • A/B testing fields (
    subjectA
    ,
    subjectB
    ,
    splitRule
    ,
    winnerCriteria
    ) require
    abTesting: true
  • scheduledAt
    uses full ISO 8601 format with timezone
适用场景:用户需要列出、查看或更新电子邮件营销活动
工具执行序列:
  1. BREVO_LIST_EMAIL_CAMPAIGNS
    - 筛选列出所有营销活动 [必填]
  2. BREVO_UPDATE_EMAIL_CAMPAIGN
    - 更新营销活动内容或设置 [可选]
列出活动的关键参数:
  • type
    : 营销活动类型('classic'或'trigger')
  • status
    : 营销活动状态('suspended'、'archive'、'sent'、'queued'、'draft'、'inProcess'、'inReview')
  • startDate
    /
    endDate
    : 日期范围筛选(格式为YYYY-MM-DDTHH:mm:ss.SSSZ)
  • statistics
    : 要包含的统计数据类型('globalStats'、'linksStats'、'statsByDomain')
  • limit
    : 每页结果数量(最大100,默认50)
  • offset
    : 分页偏移量
  • sort
    : 排序顺序('asc'或'desc')
  • excludeHtmlContent
    : 设置为
    true
    以减小响应体大小
更新活动的关键参数:
  • campaign_id
    : 营销活动数字ID(必填)
  • name
    : 营销活动名称
  • subject
    : 邮件主题
  • htmlContent
    : 邮件HTML内容(与
    htmlUrl
    互斥)
  • htmlUrl
    : HTML内容的URL地址
  • sender
    : 发件人对象,包含
    name
    email
    id
  • recipients
    : 收件人对象,包含
    listIds
    exclusionListIds
  • scheduledAt
    : 定时发送时间(格式为YYYY-MM-DDTHH:mm:ss.SSSZ)
注意事项:
  • startDate
    endDate
    必须同时提供或都不提供
  • 仅当未传入
    status
    status
    设为'sent'时,日期筛选才生效
  • htmlContent
    htmlUrl
    不可同时使用
  • 营销活动的发件人邮箱必须是Brevo中已验证的发件人
  • A/B测试字段(
    subjectA
    subjectB
    splitRule
    winnerCriteria
    )需要先设置
    abTesting: true
  • scheduledAt
    需使用带时区的完整ISO 8601格式

2. Create and Manage Email Templates

2. 创建与管理邮件模板

When to use: User wants to create, edit, list, or delete email templates
Tool sequence:
  1. BREVO_GET_ALL_EMAIL_TEMPLATES
    - List all templates [Required]
  2. BREVO_CREATE_OR_UPDATE_EMAIL_TEMPLATE
    - Create a new template or update existing [Required]
  3. BREVO_DELETE_EMAIL_TEMPLATE
    - Delete an inactive template [Optional]
Key parameters for listing:
  • templateStatus
    : Filter active (
    true
    ) or inactive (
    false
    ) templates
  • limit
    : Results per page (max 1000, default 50)
  • offset
    : Pagination offset
  • sort
    : Sort order ('asc' or 'desc')
Key parameters for create/update:
  • templateId
    : Include to update; omit to create new
  • templateName
    : Template display name (required for creation)
  • subject
    : Email subject line (required for creation)
  • htmlContent
    : HTML template body (min 10 characters; use this or
    htmlUrl
    )
  • sender
    : Sender object with
    name
    and
    email
    , or
    id
    (required for creation)
  • replyTo
    : Reply-to email address
  • isActive
    : Activate or deactivate the template
  • tag
    : Category tag for the template
Pitfalls:
  • When
    templateId
    is provided, the tool updates; when omitted, it creates
  • For creation,
    templateName
    ,
    subject
    , and
    sender
    are required
  • htmlContent
    must be at least 10 characters
  • Template personalization uses
    {{contact.ATTRIBUTE}}
    syntax
  • Only inactive templates can be deleted
  • htmlContent
    and
    htmlUrl
    are mutually exclusive
适用场景:用户需要创建、编辑、列出或删除邮件模板
工具执行序列:
  1. BREVO_GET_ALL_EMAIL_TEMPLATES
    - 列出所有模板 [必填]
  2. BREVO_CREATE_OR_UPDATE_EMAIL_TEMPLATE
    - 创建新模板或更新现有模板 [必填]
  3. BREVO_DELETE_EMAIL_TEMPLATE
    - 删除非活跃模板 [可选]
列出模板的关键参数:
  • templateStatus
    : 筛选活跃(
    true
    )或非活跃(
    false
    )模板
  • limit
    : 每页结果数量(最大1000,默认50)
  • offset
    : 分页偏移量
  • sort
    : 排序顺序('asc'或'desc')
创建/更新模板的关键参数:
  • templateId
    : 传入该参数则更新模板;不传入则创建新模板
  • templateName
    : 模板显示名称(创建时必填)
  • subject
    : 邮件主题(创建时必填)
  • htmlContent
    : 模板HTML内容(至少10个字符;与
    htmlUrl
    二选一)
  • sender
    : 发件人对象,包含
    name
    email
    ,或
    id
    (创建时必填)
  • replyTo
    : 回复邮箱地址
  • isActive
    : 激活或停用模板
  • tag
    : 模板分类标签
注意事项:
  • 传入
    templateId
    时工具执行更新操作;不传入则执行创建操作
  • 创建模板时,
    templateName
    subject
    sender
    为必填项
  • htmlContent
    长度至少为10个字符
  • 模板个性化需使用
    {{contact.ATTRIBUTE}}
    语法
  • 仅非活跃模板可被删除
  • htmlContent
    htmlUrl
    不可同时使用

3. Manage Senders

3. 管理发件人

When to use: User wants to view authorized sender identities
Tool sequence:
  1. BREVO_GET_ALL_SENDERS
    - List all verified senders [Required]
Key parameters: (none required)
Pitfalls:
  • Senders must be verified before they can be used in campaigns or templates
  • Sender verification is done through the Brevo web interface, not via API
  • Sender IDs can be used in
    sender.id
    fields for campaigns and templates
适用场景:用户需要查看已授权的发件人身份
工具执行序列:
  1. BREVO_GET_ALL_SENDERS
    - 列出所有已验证的发件人 [必填]
关键参数: 无必填参数
注意事项:
  • 发件人必须先经过验证,才能用于营销活动或模板
  • 发件人验证需通过Brevo网页界面完成,无法通过API操作
  • 发件人ID可用于营销活动和模板的
    sender.id
    字段

4. Configure A/B Testing Campaigns

4. 配置A/B测试营销活动

When to use: User wants to set up or modify A/B test settings on a campaign
Tool sequence:
  1. BREVO_LIST_EMAIL_CAMPAIGNS
    - Find the target campaign [Prerequisite]
  2. BREVO_UPDATE_EMAIL_CAMPAIGN
    - Configure A/B test settings [Required]
Key parameters:
  • campaign_id
    : Campaign to configure
  • abTesting
    : Set to
    true
    to enable A/B testing
  • subjectA
    : Subject line for variant A
  • subjectB
    : Subject line for variant B
  • splitRule
    : Percentage split for the test (1-99)
  • winnerCriteria
    : 'open' or 'click' for determining the winner
  • winnerDelay
    : Hours to wait before selecting winner (1-168)
Pitfalls:
  • A/B testing must be enabled (
    abTesting: true
    ) before setting variant fields
  • splitRule
    is the percentage of contacts that receive variant A
  • winnerDelay
    defines how long to test before sending the winner to remaining contacts
  • Only works with 'classic' campaign type
适用场景:用户需要为营销活动设置或修改A/B测试配置
工具执行序列:
  1. BREVO_LIST_EMAIL_CAMPAIGNS
    - 找到目标营销活动 [前置步骤]
  2. BREVO_UPDATE_EMAIL_CAMPAIGN
    - 配置A/B测试设置 [必填]
关键参数:
  • campaign_id
    : 要配置的营销活动ID
  • abTesting
    : 设置为
    true
    以启用A/B测试
  • subjectA
    : 变体A的邮件主题
  • subjectB
    : 变体B的邮件主题
  • splitRule
    : 测试流量分配比例(1-99)
  • winnerCriteria
    : 获胜判定标准('open'或'click')
  • winnerDelay
    : 等待选择获胜变体的时长(1-168小时)
注意事项:
  • 必须先启用A/B测试(
    abTesting: true
    ),才能设置变体相关字段
  • splitRule
    是接收变体A的联系人占比
  • winnerDelay
    定义测试持续时长,之后会向剩余联系人发送获胜变体
  • 仅适用于'classic'类型的营销活动

Common Patterns

通用模式

Campaign Lifecycle

营销活动生命周期

1. Create campaign (status: draft)
2. Set recipients (listIds)
3. Configure content (htmlContent or htmlUrl)
4. Optionally schedule (scheduledAt)
5. Send or schedule via Brevo UI (API update can set scheduledAt)
1. 创建营销活动(状态:draft)
2. 设置收件人列表(listIds)
3. 配置活动内容(htmlContent 或 htmlUrl)
4. 可选:设置定时发送时间(scheduledAt)
5. 通过Brevo界面发送或设置定时(API更新也可设置scheduledAt)

Pagination

分页处理

  • Use
    limit
    (page size) and
    offset
    (starting index)
  • Default limit is 50; max varies by endpoint (100 for campaigns, 1000 for templates)
  • Increment
    offset
    by
    limit
    each page
  • Check
    count
    in response to determine total available
  • 使用
    limit
    (每页数量)和
    offset
    (起始索引)实现分页
  • 默认每页数量为50;不同端点的最大值不同(营销活动为100,模板为1000)
  • 每次分页将
    offset
    增加
    limit
  • 通过响应中的
    count
    字段判断总结果数

Template Personalization

模板个性化语法

- First name: {{contact.FIRSTNAME}}
- Last name: {{contact.LASTNAME}}
- Custom attribute: {{contact.CUSTOM_ATTRIBUTE}}
- Mirror link: {{mirror}}
- Unsubscribe link: {{unsubscribe}}
- 名字:{{contact.FIRSTNAME}}
- 姓氏:{{contact.LASTNAME}}
- 自定义属性:{{contact.CUSTOM_ATTRIBUTE}}
- 镜像链接:{{mirror}}
- 退订链接:{{unsubscribe}}

Known Pitfalls

已知注意事项

Date Formats:
  • All dates use ISO 8601 with milliseconds: YYYY-MM-DDTHH:mm:ss.SSSZ
  • Pass timezone in the date-time format for accurate results
  • startDate
    and
    endDate
    must be used together
Sender Verification:
  • All sender emails must be verified in Brevo before use
  • Unverified senders cause campaign creation/update failures
  • Use GET_ALL_SENDERS to check available verified senders
Rate Limits:
  • Brevo API has rate limits per account plan
  • Implement backoff on 429 responses
  • Template operations have lower limits than read operations
Response Parsing:
  • Response data may be nested under
    data
    or
    data.data
  • Parse defensively with fallback patterns
  • Campaign and template IDs are numeric integers
日期格式:
  • 所有日期均使用带毫秒的ISO 8601格式:YYYY-MM-DDTHH:mm:ss.SSSZ
  • 日期时间格式中需包含时区以保证结果准确
  • startDate
    endDate
    必须同时使用
发件人验证:
  • 所有用于营销活动或模板的发件人邮箱必须先在Brevo中完成验证
  • 未验证的发件人会导致营销活动创建/更新失败
  • 可使用GET_ALL_SENDERS查看已验证的发件人列表
速率限制:
  • Brevo API根据账户套餐设置速率限制
  • 收到429响应时需实现重试退避机制
  • 模板操作的速率限制低于读取类操作
响应解析:
  • 响应数据可能嵌套在
    data
    data.data
  • 需采用防御式解析并设置回退逻辑
  • 营销活动和模板ID均为数字整数

Quick Reference

快速参考

TaskTool SlugKey Params
List campaignsBREVO_LIST_EMAIL_CAMPAIGNStype, status, limit, offset
Update campaignBREVO_UPDATE_EMAIL_CAMPAIGNcampaign_id, subject, htmlContent
List templatesBREVO_GET_ALL_EMAIL_TEMPLATEStemplateStatus, limit, offset
Create templateBREVO_CREATE_OR_UPDATE_EMAIL_TEMPLATEtemplateName, subject, htmlContent, sender
Update templateBREVO_CREATE_OR_UPDATE_EMAIL_TEMPLATEtemplateId, htmlContent
Delete templateBREVO_DELETE_EMAIL_TEMPLATEtemplateId
List sendersBREVO_GET_ALL_SENDERS(none)
任务工具标识关键参数
列出营销活动BREVO_LIST_EMAIL_CAMPAIGNStype, status, limit, offset
更新营销活动BREVO_UPDATE_EMAIL_CAMPAIGNcampaign_id, subject, htmlContent
列出邮件模板BREVO_GET_ALL_EMAIL_TEMPLATEStemplateStatus, limit, offset
创建邮件模板BREVO_CREATE_OR_UPDATE_EMAIL_TEMPLATEtemplateName, subject, htmlContent, sender
更新邮件模板BREVO_CREATE_OR_UPDATE_EMAIL_TEMPLATEtemplateId, htmlContent
删除邮件模板BREVO_DELETE_EMAIL_TEMPLATEtemplateId
列出发件人BREVO_GET_ALL_SENDERS