Repository navigation
docs(automation): spell the merge-field example with this app's real names (#863) - #911
Merged
Merged
Conversation
…names (#863) The "Email templates" section illustrated merge fields with `{{Opportunity.Name}}` and `{{Account.Owner.Email}}` — Salesforce-style PascalCase naming nothing in this app, against AGENTS.md's name-parity rule (source = runtime = DB = URL = docs). HotCRM's objects are `crm_opportunity` and `crm_contact`; its fields are `name`, `owner_id`, `email`. The `{{path.to.value}}` syntax itself was correct and stays: spec 17.0.0-rc.3's `EmailTemplateDefinitionSchema` documents subject/body placeholders rendered against a per-send `data` payload, with variable names as snake_case or dotted paths. The replacement does not invent a payload shape. Whether a template reads `{{name}}`, `{{record.name}}` or `{{crm_opportunity.name}}` depends on the payload the caller passes to `sendTemplate()`, and this repo has no caller (`sendTemplate` / `email_template`: zero occurrences under `src/`). The bullet gives the real spellings, states that the root of the path is the sender's choice, and points authors at the template's own `variables` list. Three language files, one bullet each. Documentation only.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #863
改了什么
content/docs/administration/automation{,.zh-Hans,.zh-Hant}.mdx「电子邮件模板」节的合并字段 bullet 一行 ×3 语言,其余一行未动。改前(三语同形):
Opportunity/Name/Account.Owner.Email在本仓不是任何对象或字段的拼写,是 Salesforce 式 PascalCase 的借用。本仓的对象是crm_opportunity/crm_account/crm_contact,字段是name/owner_id/email,而 AGENTS.md 对此是硬约束(复核仍在):同页其余引用字段的地方(flow 表的
end_date、expiration_date、owner_id)用的都是真实拼写,只有这一条例外。管理员在 设置 → 电子邮件模板 里照抄它,写出来的路径对不上任何值。改后(英文,中文两版同义):
stale-premise 复核(rc.3 基线)
issue 的两条 spec 主张在 17.0.0-rc.3 上逐字复核,均成立 ——
node_modules/@objectstack/spec/src/system/email-template.zod.ts:{{path.to.value}}placeholders rendered against a per-senddatapayload" → 占位符语法本身是对的,本 PR 不动语法,只动路径拼写。EmailTemplateDefinitionVariableSchema.name的 describe:"Variable name as referenced in placeholders (snake_case or dotted path)" → snake_case 正是本仓的命名法。{{Opportunity.Name}}/{{Account.Owner.Email}}在本仓content/内仅这 3 处命中,全部改掉。为什么不写
{{record.name}}这类前缀形状issue 给的两个选项里采用「不依赖载荷形状」的一个。占位符路径从哪一层写起,取决于每次发送传入的
data载荷形状,该形状由sendTemplate()的调用方决定;而本仓没有任何调用方可供实测 ——sendTemplate与email_template在src//content//objectstack.config.ts下零命中,与 #834 在编译产物里的结论一致。所以这一行只承诺两件本仓能证明的事:拼写用真名,以及路径根部由发送方决定;并把作者指向模板自己的
variables列表(spec 里声明占位符名字的地方),而不虚构{{record.name}}/{{crm_opportunity.name}}之类未经实测的形状当作「正确答案」。边界
workflows残留族:faq / performance-and-limits 的「重新评估 5 次后停止」是 PR #854 已判虚构那条说法的未清扫副本,quotes:141 指向不存在的配置面 #899 明确排除 automation 页,无交叠。integrations页 payload 的三语译法)、调用方 / 呼叫方。@objectstack/*版本与releases/未触碰。.changeset/automation-docs-merge-field-spelling.md。验证
本地全绿(退出码均为 0):
pnpm validatepnpm typechecktsc --noEmit无输出pnpm lintpnpm hygienepnpm builddist/objectstack.json1921.4 KBpnpm test -- --maxWorkers=2守卫盲区如实说明:本仓没有针对文档正文的断言测试(仅
scripts/check-source-hygiene.mjs对content/做控制字节与体积扫描),因此这三行文字的正确性由上面的源码比对承担,而不是由某个门把守 —— 对这三行,所有门的 predicted 结果都是 GREEN,实测亦然。push 前对四个改动文件做了控制字节自扫grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f]',无命中。未起 dev server。Generated by Claude Code