Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .changeset/automation-docs-merge-field-spelling.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
'hotcrm': patch
---

Spell the Automation page's merge-field example the way this app spells names, in
all three languages. The "Email templates" section on
`content/docs/administration/automation.mdx` (and its `.zh-Hans` / `.zh-Hant`
siblings) opened its bullet list with `{{Opportunity.Name}}` and
`{{Account.Owner.Email}}` — Salesforce-style PascalCase that names nothing here.
HotCRM's objects are `crm_opportunity` and `crm_contact`; its fields are `name`,
`owner_id`, `email`. AGENTS.md holds that parity as a hard rule — *the name in
source = the name at runtime = the name in DB = the name in URL = the name in
docs. No translation layer* — and the rest of the same page already keeps it
(`end_date`, `expiration_date`, `owner_id`). Only this bullet was borrowing
another product's vocabulary, which an admin authoring a template under
**Setup → Email Templates** would have copied into paths that resolve to nothing.

The placeholder *syntax* was never the problem and is unchanged.
`EmailTemplateDefinitionSchema` in `@objectstack/spec` 17.0.0-rc.3 documents
subject and body as carrying simple `{{path.to.value}}` placeholders rendered
against a per-send `data` payload, and describes each declared variable's `name`
as "snake_case or dotted path".

What the bullet deliberately does *not* do is invent a payload shape. Whether a
template reads `{{name}}`, `{{record.name}}` or `{{crm_opportunity.name}}` depends
on the `data` payload the caller passes to `sendTemplate()`, the caller decides
that shape, and this repo has no caller to measure it from — `sendTemplate` and
`email_template` have zero occurrences under `src/`, consistent with the compiled
artifact carrying no email-template metadata (#834). So the bullet now gives the
real spellings, says plainly that where the path is rooted is the sender's choice,
and points template authors at the template's own `variables` list rather than at
a shape nobody in this repo has exercised.

Documentation only — one bullet per language file. No metadata, behaviour or field
changes. Fixes #863.
2 changes: 1 addition & 1 deletion content/docs/administration/automation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Understanding this order helps debug *"why didn't my flow fire?"* questions.

Most automation actions send email. Templates live in **Setup → Email Templates** and support:

- **Merge fields** — `{{Opportunity.Name}}`, `{{Account.Owner.Email}}`.
- **Merge fields** — `{{path.to.value}}` placeholders, rendered against the `data` payload passed on that send. Spell every segment the way HotCRM spells it — objects are `crm_opportunity` and `crm_contact`, fields are `name`, `owner_id`, `email` — never Salesforce-style `Opportunity.Name`. What the path is rooted at depends on the payload shape the sender passes, and this app ships no `sendTemplate()` caller to copy one from, so declare the names your template reads in its `variables` list and agree the shape with whoever sends the mail.
- **Conditional blocks** — show only if a condition is true.
- **HTML + plain text** versions.
- **Attachments** — quote PDFs, contract PDFs.
Expand Down
2 changes: 1 addition & 1 deletion content/docs/administration/automation.zh-Hans.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ HotCRM 内置的 **商机审批** 流程串联两个 approval 节点实现分级

大多数自动化操作会发送电子邮件。模板位于 **设置 → 电子邮件模板**,并支持:

- **合并字段** —— `{{Opportunity.Name}}`、`{{Account.Owner.Email}}`。
- **合并字段** —— `{{path.to.value}}` 占位符,按每次发送传入的 `data` 载荷渲染。路径的每一段都写 HotCRM 自己的拼写 —— 对象是 `crm_opportunity`、`crm_contact`,字段是 `name`、`owner_id`、`email` —— 而不是 Salesforce 式的 `Opportunity.Name`。路径从哪一层写起,取决于发送方传入的载荷形状;本应用没有任何 `sendTemplate()` 调用方可供照抄,所以请把模板要读的名字声明在它的 `variables` 列表里,并与发送方约定好载荷形状。
- **条件块** —— 仅在条件为真时显示。
- **HTML + 纯文本** 版本。
- **附件** —— 报价 PDF、合同 PDF。
Expand Down
2 changes: 1 addition & 1 deletion content/docs/administration/automation.zh-Hant.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ HotCRM 內建的 **商機審批** 流程串聯兩個 approval 節點實作分級

大多數自動化操作會傳送電子郵件。範本位於 **設定 → 電子郵件範本**,並支援:

- **合併欄位** —— `{{Opportunity.Name}}`、`{{Account.Owner.Email}}`。
- **合併欄位** —— `{{path.to.value}}` 佔位符,依每次傳送傳入的 `data` 酬載渲染。路徑的每一段都寫 HotCRM 自己的拼寫 —— 物件是 `crm_opportunity`、`crm_contact`,欄位是 `name`、`owner_id`、`email` —— 而不是 Salesforce 式的 `Opportunity.Name`。路徑從哪一層寫起,取決於傳送方傳入的酬載形狀;本應用沒有任何 `sendTemplate()` 呼叫方可供照抄,因此請把範本要讀取的名稱宣告在它的 `variables` 清單裡,並與傳送方約定好酬載形狀。
- **條件區塊** —— 僅在條件為真時顯示。
- **HTML + 純文字** 版本。
- **附件** —— 報價 PDF、合約 PDF。
Expand Down
Loading