@mambasms/mcp-server 0.6.17 → 0.6.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,72 +1,76 @@
1
- # 模块:邮件模板
2
-
3
- > 何时读我:客户要建/改/预览/测试邮件模板,或要从别处迁移模板。
4
- > 相关:emailDesign 字段见 [`../references/email-design.md`](../references/email-design.md);图片见 [`assets-and-social.md`](assets-and-social.md)。
5
-
6
- ---
7
-
8
- ## 1. 三条创建路径(模板只有「组件形态」)
9
-
10
- 模板没有“富文本/HTML 模式”之分,**一律是组件树**;`html` 只是组件树里的一个「html 区块」。
11
-
12
- | 路径 | 工具 | 适用 |
13
- |---|---|---|
14
- | **结构化(首选)** | `template_create_from_design(title, email_design, ...)` | 内容+配色由 AI 给,渲染引擎生成合规、可后台拖拽的组件树 |
15
- | 语义区块 | `template_create(title, sections)` | 购物车 / 浏览挽回等**动态区块**(发送时填该联系人的数据) |
16
- | 整份 HTML | `template_create(title, html)` | 迁移现成 HTML;后台仍按 HTML 区块编辑 |
17
- | 文件迁移 | `template_import(url, source_type)` | `.mambatpl` 或设计工具导出的 zipHtml(图片自动转存 CDN) |
18
-
19
- **开工前**:先 `template_list_system` 看有没有贴合的系统模板(客户选“用模板”时必做),再决定是套用还是从零生成。
20
-
21
- ---
22
-
23
- ## 2. 结构化生成的顺序(照这个顺序,别跳)
24
-
25
- ```
26
- 1) template_list_system() # 有贴合的就取 id(可选)
27
- 2) catalog_query(topic="emailDesign") # 字段规范(真源)
28
- 需要版式 → catalog_query(topic="layouts") # promo-hero / promo-flash / ...
29
- 需要配色 → catalog_query(topic="styles")
30
- 3) template_create_from_design(
31
- title, email_design,
32
- template_id=?, # 套系统模板(可选)
33
- layout_skeleton=?, # 用骨架(与 template_id 二选一)
34
- summary=?
35
- )
36
- 4) template_preview(id) # 免登预览链接
37
- 5) template_send_test(id, emails=[...]) # ≤10 人,同店 2 分钟限频
38
- ```
39
-
40
- ## 3. 内容要点(踩过的坑)
41
-
42
- - **商品位展示的是店铺真实商品**:`emailDesign.products[].name` 要与店铺商品标题对得上,否则商品位用热销商品补位,客户会说“这不是我点的那款”
43
- - **页脚退订由系统生成**,但手写 HTML 时正文里必须有 `{Unsubscribe}`
44
- - **社媒不要自己造**:优先套系统模板(页脚图标);手写时用 `template_snippets(type="footer-social")`,放最底部
45
- - 买家可见文案一律**英文**;`{{ }}` 与 `{ }` 不能混用
46
- - 活动正文质量闸门(≥4200 字符)不适用于模板,但模板短到只有一两行时客户体验差,建议至少 hero+正文+CTA+页脚
47
-
48
- ## 4. 修改与删除
49
-
50
- | 操作 | 工具 | 注意 |
51
- |---|---|---|
52
- | 改 | `template_update(id, title/html/sections/summary)` | 至少给一项;不传正文则保留原内容 |
53
- | 只改标题 | `template_update(id, title=...)` | 最安全,不动正文 |
54
- | 删 | `template_delete(id)` | **被活动/流程引用时拒绝**(这是保护);先在后台解除引用 |
55
-
56
- ## 5. 查询与迁移
57
-
58
- | 工具 | 用途 |
59
- |---|---|
60
- | `template_list(page_number, page_size)` | 我的模板列表(≤500/页) |
61
- | `template_get(id)` | 详情(**返回示例数据渲染预览**,占位符已被替换;不要当原模板改回去) |
62
- | `template_export(id)` | 导出 `.mambatpl`,返回 CDN 地址(备份/换店) |
63
- | `template_import(url, source_type)` | `mambatpl` 或 `zipHtml`;zip 里的图片会转存 CDN |
64
- | `template_snippets(type)` | `header-basic` / `footer-basic` / `footer-social` 参考片段 |
65
- | `block_library_query` | 编辑器预置区块(页头/页脚/按钮组等) |
66
-
67
- ## 6. 自检清单
68
-
69
- - [ ] `template_preview` 能打开,且内容与需求一致(主标题/商品/优惠/CTA)
70
- - [ ] 页脚有退订;社媒是图标、在底部
71
- - [ ] 占位符没被示例数据污染(改模板时用原始 HTML,不要用 `template_get` 的渲染结果)
72
- - [ ] 交付时给出模板 id + 预览链接 + 一句话“可在后台拖拽微调”
1
+ # 模块:邮件模板
2
+
3
+ > 何时读我:客户要建/改/预览/测试邮件模板,或要从别处迁移模板。
4
+ > 相关:emailDesign 字段见 [`../references/email-design.md`](../references/email-design.md);图片见 [`assets-and-social.md`](assets-and-social.md)。
5
+
6
+ ---
7
+
8
+ ## 1. 三条创建路径(模板只有「组件形态」)
9
+
10
+ 模板没有“富文本/HTML 模式”之分,**一律是组件树**;`html` 只是组件树里的一个「html 区块」。
11
+
12
+ | 路径 | 工具 | 适用 |
13
+ |---|---|---|
14
+ | **结构化(首选)** | `template_create_from_design(title, email_design, ...)` | 内容+配色由 AI 给,渲染引擎生成合规、可后台拖拽的组件树 |
15
+ | 语义区块 | `template_create(title, sections)` | 购物车 / 浏览挽回等**动态区块**(发送时填该联系人的数据) |
16
+ | 整份 HTML | `template_create(title, html)` | 迁移现成 HTML;后台仍按 HTML 区块编辑 |
17
+ | 文件迁移 | `template_import(url, source_type)` | `.mambatpl` 或设计工具导出的 zipHtml(图片自动转存 CDN) |
18
+
19
+ **开工前**:先 `template_list_system` 看有没有贴合的系统模板(客户选“用模板”时必做),再决定是套用还是从零生成。
20
+
21
+ ---
22
+
23
+ ## 2. 结构化生成的顺序(照这个顺序,别跳)
24
+
25
+ ```
26
+ 1) template_list_system() # 有贴合的就取 id(可选)
27
+ 2) catalog_query(topic="emailDesign") # 字段规范(真源)
28
+ 需要版式 → catalog_query(topic="layouts") # promo-hero / promo-flash / ...
29
+ 需要配色 → catalog_query(topic="styles")
30
+ 3) template_create_from_design(
31
+ title, email_design,
32
+ template_id=?, # 套系统模板(可选)
33
+ layout_skeleton=?, # 用骨架(与 template_id 二选一)
34
+ summary=?
35
+ )
36
+ 4) template_preview(id) # 免登预览链接
37
+ 5) template_send_test(id, emails=[...]) # ≤10 人,同店 2 分钟限频
38
+ ```
39
+
40
+ ## 3. 内容要点(踩过的坑)
41
+
42
+ - **商品位展示的是店铺真实商品**:`emailDesign.products[].name` 要与店铺商品标题对得上,否则商品位用热销商品补位,客户会说“这不是我点的那款”
43
+ - **页脚退订由系统生成**,但手写 HTML 时正文里必须有 `{Unsubscribe}`
44
+ - **社媒不要自己造**:优先套系统模板(页脚图标);手写时用 `template_snippets(type="footer-social")`,放最底部
45
+ - 买家可见文案一律**英文**;`{{ }}` 与 `{ }` 不能混用
46
+ - 活动正文质量闸门(≥4200 字符)不适用于模板,但模板短到只有一两行时客户体验差,建议至少 hero+正文+CTA+页脚
47
+
48
+ ## 4. 修改与删除
49
+
50
+ | 操作 | 工具 | 注意 |
51
+ |---|---|---|
52
+ | 改 | `template_update(id, title/html/sections/summary)` | 至少给一项;不传正文则保留原内容 |
53
+ | 只改标题 | `template_update(id, title=...)` | 最安全,不动正文 |
54
+ | 删 | `template_delete(id)` | **被活动/流程引用时拒绝**(这是保护);先在后台解除引用 |
55
+
56
+ ## 5. 查询与迁移
57
+
58
+ | 工具 | 用途 |
59
+ |---|---|
60
+ | `template_list(page_number, page_size)` | 我的模板列表(≤500/页) |
61
+ | `template_get(id)` | 详情(**返回示例数据渲染预览**,占位符已被替换;不要当原模板改回去) |
62
+ | `template_export(id)` | 导出 `.mambatpl`,返回 CDN 地址(备份/换店) |
63
+ | `template_import(url, source_type)` | `mambatpl` 或 `zipHtml`;zip 里的图片会转存 CDN |
64
+ | `template_snippets(type)` | `header-basic` / `footer-basic` / `footer-social` 参考片段 |
65
+ | `block_library_query` | 编辑器预置区块(页头/页脚/按钮组等) |
66
+
67
+ ## 6. 自检清单
68
+
69
+ - [ ] `template_preview` 能打开,且内容与需求一致(主标题/商品/优惠/CTA)
70
+ - [ ] 页脚有退订;社媒是图标、在底部
71
+ - [ ] 占位符没被示例数据污染(改模板时用原始 HTML,不要用 `template_get` 的渲染结果)
72
+ - [ ] 交付时给出模板 id + 预览链接 + 一句话“可在后台拖拽微调”
73
+
74
+ ---
75
+
76
+ **可执行示例(契约)**:[`../examples/templates.json`](../examples/templates.json) —— CI 会用测试店铺真跑一遍,文档与实现漂移会立刻报错。