声明类型推断验证状态待复核
私域运营面临邮件跟进打不开——邮件序列优化将复购率从8%提到12%,年化增收13万元
Skill-Post-Purchase-Email-Sequence-Optimizer
私域运营面临邮件跟进打不开——邮件序列优化将复购率从8%提到12%,年化增收13万元
50-200 万元
待企业数据验证 · 缺失:样本、基线、时间窗、币种、计算方法、证据来源
私域运营面临邮件跟进打不开——邮件序列优化将复购率从8%提到12%,年化增收13万元
核心思想:购后邮件序列(Post-Purchase Email Flow)是 DTC 品牌成本最低、ROI 最高的 LTV 工具。但大多数团队发送的是时间驱动的固定序列(下单后 D+3/D+7/D+30 自动发),而非行为驱动的个性化路径。基于强化学习的邮件序列优化,通过 Contextual Bandit 算法动态选择每个用户的最优触达时机、主题和内容组合。
优化框架(四层设计):
Layer 1: 用户状态建模
状态向量 S_t = [
购买阶段(首购/复购N次/高频忠诚),
购后天数(0-7d / 7-30d / 30-90d / 90d+),
产品品类(吸奶器→配件/奶粉→再购),
上一封邮件的行为(open/click/ignore/unsubscribe),
历史 RFM 分层(冠军/潜力/流失风险),
季节性标记(大促临近/节日/孩子生日预测)
]Layer 2: 邮件动作空间
A = {
"review_request": 请求评论(最佳发送窗口:使用满意后),
"cross_sell": 交叉销售推荐(基于购买品类的互补品),
"educational": 使用技巧内容(降低退货率,提升满意度),
"reorder_prompt": 复购提醒(消耗品:奶粉/湿纸巾/配件),
"loyalty_invite": 忠诚度计划邀请(高价值用户),
"discount_offer": 折扣优惠(流失风险用户),
"silence": 不发送(避免打扰,减少 unsubscribe)
}Layer 3: 奖励函数设计
def reward(email_action, user_response, business_outcome):
r = 0
# 直接响应奖励
if user_response == "click_to_purchase":
r += revenue * 0.3 # 邮件触发的营收贡献
if user_response == "review_submitted":
r += 5.0 # Review 价值量化
if user_response == "unsubscribe":
r -= 20.0 # 重惩 unsubscribe(长期价值损失)
# 长期 LTV 奖励(延迟信号,需 30 天窗口)
r += expected_ltv_delta * 0.1 # LTV 提升的折现奖励
return rLayer 4: Contextual Bandit 决策
算法: LinUCB(线性 UCB)或 Neural Bandit(深度学习版本)
特征输入: 用户状态向量 S_t
输出: 最优邮件动作 a* = argmax_a E[reward | S_t, a]
exploration: ε-greedy(新用户探索 ε=0.2)+ Thompson Sampling(稳定用户)关键研究基础:
场景 A:吸奶器购后序列(首购用户 LTV 激活)
场景 B:奶粉订阅用户(复购提醒 + 换月龄引导)
- 奶粉有自然的「月龄换段」节点(1段→2段→3段→4段) - 系统基于购买日期 + 儿童年龄预测下次换段时机 - 提前 2 周发送「你的宝宝快到换段年龄了」邮件 + 新段产品推荐 - 复购率可比随机发送提升 35-50%
未提取到输入条目;请核对原始 Skill 卡片与代码。
未提取到输出条目;请核对原始 Skill 卡片与代码。
代码块数量:6
from dataclasses import dataclass, field
from typing import Literal, Optional
import random
import math
# 邮件类型定义
EmailType = Literal[
"review_request", "cross_sell", "educational",
"reorder_prompt", "loyalty_invite", "discount_offer", "silence"
]
@dataclass
class UserState:
user_id: str
days_since_purchase: int
product_category: str # "breast_pump" / "formula" / "toy"
purchase_count: int # 1=首购, 2+=复购
last_email_action: str # "open" / "click" / "ignore" / "unsubscribe"
rfm_segment: str # "champion" / "at_risk" / "hibernating"
predicted_ltv: float # 预测 LTV(美元)
is_near_reorder: bool # 消耗品是否接近复购时间
@dataclass
class EmailConfig:
email_type: EmailType
subject_template: str
personalization_vars: list[str]
optimal_send_time: str # "morning_9am" / "evening_8pm" / "weekend_11am"
max_frequency_days: int # 该类型邮件最小间隔天数
# 规则优先引擎(确定性规则 + bandit 兜底)
EMAIL_RULES = [
# 规则 1:有 unsubscribe 迹象 → 立即静默
{"condition": lambda s: s.last_email_action == "unsubscribe",
"action": "silence", "priority": 1},
# 规则 2:使用第 7 天 + 上封邮件有打开 → 请求评论黄金窗口
{"condition": lambda s: 5 <= s.days_since_purchase <= 10
and s.last_email_action in ["open", "click"],
"action": "review_request", "priority": 2},
# 规则 3:奶粉/消耗品接近复购周期 → 复购提醒
{"condition": lambda s: s.is_near_reorder and s.product_category == "formula",
"action": "reorder_prompt", "priority": 3},
# 规则 4:高 LTV 用户 30 天未复购 → 忠诚度邀请
{"condition": lambda s: s.predicted_ltv > 200
and s.days_since_purchase > 30
and s.purchase_count == 1,
"action": "loyalty_invite", "priority": 4},
# 规则 5:流失风险用户(rfm + 长时间无响应)→ 折扣激活
{"condition": lambda s: s.rfm_segment == "at_risk"
and s.days_since_purchase > 45,
"action": "discount_offer", "priority": 5},
]
class LinUCBEmailBandit:
"""线性 UCB Contextual Bandit,用于剩余场景的动态选择。"""
def __init__(self, n_arms: int, feature_dim: int, alpha: float = 1.0):
self.n_arms = n_arms
self.alpha = alpha # 探索系数
self.A = [np.eye(feature_dim) for _ in range(n_arms)] # 正则化矩阵
self.b = [np.zeros(feature_dim) for _ in range(n_arms)] # 奖励累积
def select_action(self, features: list[float]) -> int:
"""选择期望 UCB 最大的邮件类型。"""
import numpy as np
x = np.array(features)
ucb_scores = []
for a in range(self.n_arms):
theta = np.linalg.solve(self.A[a], self.b[a])
ucb = theta @ x + self.alpha * math.sqrt(x @ np.linalg.solve(self.A[a], x))
ucb_scores.append(ucb)
return int(np.argmax(ucb_scores))
def update(self, arm: int, features: list[float], reward: float):
"""用观测到的奖励更新 bandit 参数。"""
import numpy as np
x = np.array(features)
self.A[arm] += np.outer(x, x)
self.b[arm] += reward * x
def decide_email(user: UserState, bandit: Optional[LinUCBEmailBandit] = None) -> EmailType:
"""
两阶段决策:
1. 规则引擎(确定性强的场景)
2. LinUCB Bandit(兜底,探索未覆盖场景)
"""
# 阶段 1:规则引擎
triggered_rules = [r for r in EMAIL_RULES if r["condition"](user)]
if triggered_rules:
best_rule = min(triggered_rules, key=lambda r: r["priority"])
return best_rule["action"]
# 阶段 2:Bandit 探索
if bandit:
features = [
user.days_since_purchase / 90.0,
user.purchase_count / 5.0,
float(user.last_email_action == "open"),
float(user.last_email_action == "click"),
float(user.rfm_segment == "champion"),
user.predicted_ltv / 500.0,
float(user.is_near_reorder),
]
action_idx = bandit.select_action(features)
actions = ["cross_sell", "educational", "reorder_prompt",
"loyalty_invite", "silence"]
return actions[action_idx % len(actions)]
# 默认:educational(低风险)
return "educational"
# === 测试示例 ===
test_users = [
UserState("u001", days_since_purchase=7, product_category="breast_pump",
purchase_count=1, last_email_action="open", rfm_segment="champion",
predicted_ltv=350.0, is_near_reorder=False),
UserState("u002", days_since_purchase=60, product_category="formula",
purchase_count=3, last_email_action="ignore", rfm_segment="at_risk",
predicted_ltv=80.0, is_near_reorder=True),
UserState("u003", days_since_purchase=3, product_category="toy",
purchase_count=1, last_email_action="click", rfm_segment="champion",
predicted_ltv=120.0, is_near_reorder=False),
]
for user in test_users:
action = decide_email(user)
print(f"用户 {user.user_id} (D+{user.days_since_purchase}, {user.rfm_segment}): → {action}")
print("[✓] Email 序列决策引擎测试通过")论文链接用于核验方法来源,不自动证明本页商业结果。
未自动抽取;请查看原始 Skill 卡片。