Skip to content

docs(automation): 三语写实「电子邮件模板」节末句 —— 本仓不 ship 邮件模板,通知在 flow 的 notify 里 (#834) - #864

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-834-email-templates-sentence
Aug 6, 2026
Merged

yinlianghui merged 1 commit into
mainfrom
claude/issue-834-email-templates-sentence

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes #834

「电子邮件模板」节最后一句宣称本产品内置了五类邮件模板,而本仓一条邮件模板都没有 author。只改这一句,三语同步;该节其余四条(合并字段、条件块、HTML + 纯文本、附件)是平台能力描述,未动。

前提复核(基线 origin/main = eb4a7e1)

issue 说法 复核结果
行号 en :126 / zh-Hans :123 / zh-Hant :123 已漂移,重定位为 en :127 / zh-Hans :125 / zh-Hant :125。#854 重写同页多节确认未动本节,三语原句逐字与 issue 引用一致
dist 顶层没有 emailTemplates 成立。rm -rf dist 后重新 pnpm build 取产物(防 stale artifact),21 个顶层键:manifest, translations, i18n, objects, apps, views, pages, dashboards, reports, datasets, actions, flows, positions, permissions, sharingRules, skills, hooks, mappings, data, requires, docs。再加两条:src/ 下无 *.email-template.* 文件,产物全文 email_template 零命中
通知由 flow 的 notify 节点发出(21 个 flow 中 14 个) 成立,但数字有两个单位,两个都对:src/flows/*.flow.ts 21 个文件、14 个含字面 type: 'notify';编译产物 24 条 flow、16 条含 notify 节点(差额是 case_escalation / opportunity_approval 的 on_create 孪生,一个文件出两条 flow)
合同激活按 #823 来自 object hook 成立,且结论比「通知来自 hook」更强:contract_on_activation(src/objects/contract.hook.ts:77-126)只做盖 signed_date 与把 account 提升为 customer 两件事,一条通知都不发(#805/#823 从合同页实测的是同一件事)。所以文中写的是「合同激活不发任何通知」,不是「合同激活的通知由 hook 发」
issue 括注「EmailTemplateSchema 在 @objectstack/spec 里存在」 对锁定的 17.0.0-rc.2 已失效。该名字被平台 #4616 移除(ADR-0049 enforce-or-remove,v17 窗口),见 node_modules/@objectstack/spec/src/system/notification.zod.ts:40-46;当前 canonical 是 EmailTemplateDefinitionSchema(system/email-template.zod.ts,注册为 BUILTIN_METADATA_TYPE_SCHEMAS 里的 email_template 类型)。核心前提不受影响(本仓不 author 模板这一点独立成立),但因此不把任何一个标识符写进用户文档 —— 见下

文中不落新数字。 automation-docs-coverage 的注释专门警告「按 src/flows/* 文件数数的读者会得到第三个错数」,同页表头 (24) 与「九个计划行」都由产物派生。本次按边界不加守卫,所以新增散文里一个新数字都不写(写了就是一个没人派生、下次改 flow 就漂的数),16/24 只出现在本 PR 与 commit message 里。

改动(三语,每页一句)

en content/docs/administration/automation.mdx:127

  • 改前:Built-in templates cover lead-routing, opportunity wins, case acknowledgments, contract activations, renewal reminders.
  • 改后:HotCRM itself ships no email templates: nothing under 'src/' authors one, and the compiled app carries no email-template metadata at all. The lead-routing, opportunity-win, case and renewal notifications this app sends come from the notify nodes in the flows listed above — each one's subject and body text is written inline in its own flow, so that is where you change the wording. Contract activation sends nothing: it runs as an object hook ('src/objects/contract.hook.ts') with no notification step, and the contract mail that does go out comes from the Contract Auto-Expiration and Contract Renewal Reminder flows. Author a template in Setup → Email Templates when you need a templated outbound email of your own.

zh-Hans :125

  • 改前:内置模板涵盖潜在客户路由、商机赢单、案例确认、合同激活、续约提醒。
  • 改后:HotCRM 自身不发布任何邮件模板:src/ 下没有编写任何一条,编译产物里也不含邮件模板元数据。潜在客户路由、商机赢单、案例处理与续约提醒的通知,都由上表那些流程里的 notify 节点发出 —— 标题与正文直接写在各自的流程里,要改措辞就去改那里。合同激活不发任何通知:它由对象钩子(src/objects/contract.hook.ts)执行,链路上没有通知步骤;真正发出的合同邮件来自「合同自动到期」与「合同续约提醒」两条流程。需要自己发模板化外发邮件时,再到「设置 → 电子邮件模板」里新建模板。

zh-Hant :125 同形,术语随本页既有口径(物件鉤子 / 中繼資料 / 合約啟用),两条 flow 行标签取自守卫 ROW_LABEL(合約自動到期 / 合約續約提醒),与表内行文一字不差。

三处改动都刻意做了两件事:

  1. 与同页 :86「流程内的通知由 notify 节点投递」呼应,而不是再造第二个答案 —— 这两句原本就是一页之内互相矛盾的一对。
  2. 「案例确认」不再照抄。案例侧真实存在的是升级、SLA 超时、CSAT 跟进三类 notify,没有一条是「确认」;新句用「案例处理」概括,不替 flow 表断言收件人(那是 automation 内置 flow 表两行与 flow 实况不符:赢单提醒不发给经理、案例升级既不改派也不建任务(flow 自身 description 同错) #851 的面,本 PR 不碰)。

#800 边界如何落实

  • 主语一律是 本仓:「HotCRM 自身不发布任何邮件模板」「src/ 下没有编写任何一条」「编译产物里不含」。没有出现任何关于平台的「不存在」断言。
  • 正面保留平台模板面:该节开头「模板位于设置 → 电子邮件模板」及四条能力 bullet 一字未动,新句结尾把 Setup 明确写成「需要模板化外发邮件时去哪里新建」的去处。
  • 连平台标识符都不写进文档:EmailTemplateSchema 这个名字刚在本版本窗口被移除、换成 EmailTemplateDefinitionSchema(见上表末行),把它写进用户文档等于埋一个下次升级就漂的引用。平台侧模板面用 UI 入口表述,事实同样成立且不随版本漂。

守卫:预期不敏感,实测不敏感(含反向探针)

预测方向先写下来再跑:automation-docs-coverage 的视野是 flow 表行集/触发面 + 两个派生数词,本句在另一节的散文里,预期改前改后都绿,不存在 before-red / after-green 可演示。

npx vitest run test/automation-docs-coverage.test.ts test/docs-drift.test.ts
→ Test Files 2 passed (2)   Tests 53 passed (53)

反向探针:把原来那句假话放回英文页再单跑守卫
→ Test Files 1 passed (1)   Tests 20 passed (20)   ← 仍全绿

第二次跑证明的是:这句话从来不在任何守卫的视野里,这正是它能一直活着的原因。按派单边界本 PR 不加守卫。

验证(flock /tmp/os-heavy-verify.lock,NODE_OPTIONS=--max-old-space-size=4096)

pnpm validate  → 5 author-time warning(s)(均为既有:审批组收件人、字段组提示)  exit=0
pnpm typecheck → tsc --noEmit                                                  exit=0
pnpm build     → Logic: 24 Flows / Artifact: dist/objectstack.json (1921.3 KB)  exit=0
pnpm test      → Test Files 66 passed (66)
                 Tests 1587 passed | 1 skipped (1588)                          exit=0
pnpm lint      → 13 warning(s), 14 suggestion(s)(均为既有)                    exit=0
pnpm hygiene   → source hygiene clean                                          exit=0

控制字节自扫(pnpm hygiene 只扫 src/test/e2e/scripts,不覆盖 content/):

grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]' content/docs/administration/automation*.mdx .changeset/email-templates-sentence.md
→ 零命中(exit=1)

越界记录

同节另一条 bullet 的合并字段示例 {{Opportunity.Name}} / {{Account.Owner.Email}} 用的是本仓不存在的对象/字段拼写(本仓是 crm_opportunity / name)。未在本 PR 修改,按 Prime Directive #10 单独立单 #863(含证据边界说明:本仓无 sendTemplate 调用方,渲染结果无法端到端实测)。检索过既有 open issue,无重复。

仅文档改动,无 metadata / 行为 / 字段变更。changeset:.changeset/email-templates-sentence.md('hotcrm': patch)。


Generated by Claude Code

)

The "Email templates" section closed with a claim about this app that this app
does not implement:

  Built-in templates cover lead-routing, opportunity wins, case
  acknowledgments, contract activations, renewal reminders.

Measured on a fresh `pnpm build`: `dist/objectstack.json` has no email-template
collection among its 21 top-level keys, `grep` finds no `*.email-template.*`
file under `src/`, and the artifact does not contain the string
`email_template` once. So an admin who went to Setup looking for a "Renewal
Reminder" template to reword found nothing to edit, and the wording they were
after was somewhere else entirely: the notifications behind those business
events are `notify` node config inside the flows this same page tabulates
(16 of the 24 shipped flows carry one), with the subject and body written
inline.

The page was also contradicting itself across two sections — the sentence under
the flow table has said "notifications inside flows are delivered by the
`notify` node" all along. The replacement echoes it instead of adding a second
answer.

Contract activation is called out separately because it is not a flow: it runs
as an object hook (`src/objects/contract.hook.ts`) which sends no message at
all (#805/#823 measured the same thing from the contracts page), while the
contract mail that does go out belongs to Contract Auto-Expiration and Contract
Renewal Reminder.

Scoped to what this repo can prove — that HotCRM authors no templates. It makes
no claim about the platform's template surface (the #800 trap): Setup → Email
Templates stays the place to author one, and the section's other four bullets
describe that platform capability unchanged.

Three locales, one sentence each. Documentation only.

Claude-Session: https://claude.ai/code/session_01VHrPAGEgFDoHjphqYG4BMa

Co-authored-by: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hotcrm Ignored Ignored Aug 6, 2026 12:38am

Request Review

@yinlianghui
yinlianghui marked this pull request as ready for review August 6, 2026 00:45
@yinlianghui
yinlianghui added this pull request to the merge queue Aug 6, 2026
Merged via the queue into main with commit 4a739b0 Aug 6, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants