Tích Hợp Stripe + Brevo

Stripe + Brevo

Kết nối dữ liệu thanh toán của Stripe với lớp tương tác Brevo. Mỗi sự kiện thanh toán, tạo đăng ký, thanh toán thất bại, hoàn tiền, trở thành kích hoạt cho các tin nhắn có mục tiêu.

Máy Chủ MCP Được Sử Dụng

Máy chủGóiXác thựcMục đích
Stripe MCP@stripe/mcpKhóa APIThanh toán, đăng ký, khách hàng, hóa đơn, sản phẩm, cơ sở kiến thức
Brevo MCPmcp.brevo.com/v1/brevo/mcpTokenLiên hệ, email, SMS, WhatsApp, chiến dịch, theo dõi sự kiện

Thiết Lập

Bước 1: Kết Nối Cả Hai Máy Chủ MCP

{
"mcpServers": {
"stripe": {
"command": "npx",
"args": ["-y", "@stripe/mcp"],
"env": {
"STRIPE_SECRET_KEY": "sk_live_your-stripe-key"
}
},
"brevo": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.brevo.com/v1/brevo/mcp",
"--header",
"Authorization: Bearer ${BREVO_MCP_TOKEN}"
],
"env": {
"BREVO_MCP_TOKEN": "your-brevo-mcp-token"
}
}
}
}

Bước 2: Xác Minh

> Hiển thị các đăng ký Stripe được tạo trong tuần này
> Liệt kê các mẫu email Brevo của tôi

Trường Hợp Sử Dụng 1: Tác Nhân Chiến Dịch Sự Kiện Thanh Toán

Ánh xạ sự kiện Stripe sang tương tác Brevo:

---
name: stripe-payment-campaigns
description: Trigger Brevo campaigns from Stripe payment events
version: 1.0.0
temperature: 0.2
tools:
- stripe
- brevo_contacts
- brevo_email_campaign_management
- brevo_templates
- brevo_sms_campaigns
triggers:
- event: payment_intent.succeeded
- event: invoice.payment_failed
- event: customer.subscription.created
- event: customer.subscription.deleted
- event: charge.refunded
---
# Payment Event Campaign Agent
Listen for Stripe payment events and trigger the appropriate
Brevo engagement campaign.
## Event-to-Campaign Mapping
| Stripe Event | Brevo Action | Timing |
|-------------|-------------|--------|
| `payment_intent.succeeded` | Send receipt + thank you email | Immediate |
| `invoice.payment_failed` | Send payment failed email + SMS | Immediate |
| `invoice.payment_failed` (2nd attempt) | Send urgent SMS with update link | +24h |
| `customer.subscription.created` | Welcome sequence (3 emails over 7 days) | Immediate |
| `customer.subscription.updated` | Plan change confirmation email | Immediate |
| `customer.subscription.deleted` | Cancellation survey + win-back sequence | Immediate + 7 days |
| `charge.refunded` | Refund confirmation + feedback request | Immediate |
| `invoice.upcoming` | Renewal reminder with usage summary | 3 days before |
## Failed Payment Recovery
Critical revenue recovery flow:
1. **Attempt 1 fails**: Email with "Update payment method" CTA
2. **+24 hours**: SMS with direct link to billing portal
3. **+72 hours**: Email from founder: "We don't want to lose you"
4. **+7 days (final)**: Last chance email with grace period deadline
## Rules
- ALWAYS sync Stripe customer email to Brevo before sending
- NEVER expose full payment details in emails (last 4 digits only)
- Track events: stripe_payment_email_sent, stripe_recovery_success
- For failed payments, stop sequence immediately if payment succeeds

Trường Hợp Sử Dụng 2: Tác Nhân Vòng Đời Đăng Ký

Quản lý toàn bộ hành trình đăng ký:

---
name: stripe-subscription-lifecycle
description: Manage subscription engagement from signup through renewal
version: 1.0.0
temperature: 0.3
tools:
- stripe
- brevo_contacts
- brevo_email_campaign_management
- brevo_segments
- brevo_templates
triggers:
- schedule: "0 8 * * *"
---
# Subscription Lifecycle Agent
Daily check of subscription states to drive engagement:
## Daily Tasks
1. **New subscriptions (last 24h)**
- Create/update Brevo contact with plan details
- Add to plan-specific segment
- Trigger onboarding sequence
2. **Renewals coming (next 7 days)**
- Send renewal reminder with usage summary
- For annual plans: send "year in review" email
3. **Trials expiring (next 3 days)**
- Send trial-to-paid conversion email
- SMS reminder on last day
4. **Recently churned (last 7 days)**
- Add to win-back segment
- Schedule win-back sequence (day 7, 14, 30)
## Brevo Attributes from Stripe
| Stripe Data | Brevo Attribute |
|------------|-----------------|
| subscription.plan.name | PLAN_NAME |
| subscription.current_period_end | RENEWAL_DATE |
| subscription.status | SUBSCRIPTION_STATUS |
| customer.currency | CURRENCY |
| invoice.amount_paid (sum) | LIFETIME_REVENUE |
| subscription.created | SUBSCRIPTION_START |
## Rules
- ALWAYS use customer's currency when displaying amounts
- Segment by plan tier for differentiated messaging
- Track MRR impact of each campaign for ROI reporting

Ví Dụ: Điều Phối Theo Thời Gian Thực

Bạn: "Tôi thấy hôm nay có 5 thanh toán thất bại. Kiểm tra xem cái nào
là khách hàng đăng ký và bắt đầu chuỗi khôi phục."
Claude: Đang kiểm tra Stripe để tìm thanh toán thất bại hôm nay...
[Sử dụng Stripe MCP để liệt kê các hóa đơn thất bại gần đây]
Tìm thấy 5 thanh toán thất bại:
- 3 là khách hàng đăng ký (gói hàng tháng)
- 2 là thanh toán một lần
Cho 3 khách hàng đăng ký:
[Sử dụng brevo_contacts để xác minh liên hệ tồn tại]
[Sử dụng brevo_email_campaign_management để gửi email thanh toán thất bại]
[Sử dụng brevo_sms_campaigns để lên lịch SMS theo dõi sau +24h]
Chuỗi khôi phục đã bắt đầu cho 3 khách hàng:
- [email protected], Gói Pro ($49/tháng), email đã gửi
- [email protected], Gói Business ($99/tháng), email đã gửi
- [email protected], Gói Pro ($49/tháng), email đã gửi
- SMS theo dõi được lên lịch cho ngày mai nếu chưa giải quyết

Các Bước Tiếp Theo

Trợ lý AI

Xin chào! Hãy hỏi tôi về tài liệu.

Bắt đầu miễn phí với Brevo