You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 85fdc6d
Browse filesBrowse the repository at this point in the historyBrowse files
feat(rest, plugin-email): preview an email template through the real send-time renderer, the pending draft when one exists
8
+
9
+
Clause-②: yes
10
+
Metadata-protocol: none
11
+
12
+
Who sees it: an administrator who previews an email template, and anyone reviewing a template the AI assistant or an MCP client left as a pending draft.
13
+
14
+
-**New door `POST /api/v1/email/render`.** It renders a saved email template by name against sample values the caller types, through the same locale ladder, required-variable check and renderer a send uses. Nothing is delivered, nothing is queued, no mail-log (`sys_email`) row is written and no business record is read. It requires the mail capability (`manage_platform_settings`), as the send door does. The body is a closed set: `template` (required), `data`, `locale`, `timezone`, `currency`, `package`, `previewDrafts`; any other key, an inline subject or body included, is refused `400`.
15
+
-**The pending draft.** With `previewDrafts: true`, a caller the draft-read admission admits (the system, or a holder of `studio.access`, `setup.access` or `manage_metadata`) gets each language member's pending draft where one exists, and a template that exists only as a draft renders. A caller it does not admit gets the published rendering, never a refusal.
16
+
-**The answer says what it rendered:**`version` (`draft` or `published`), `locale`, and for a draft its `publishVerdict`, what a publish of that draft would refuse. The send's own refusals keep their sentence: a missing required variable answers `400` with `details.refusal: 'MISSING_VARIABLES'`, an unknown template `404`.
17
+
-**Contract (`@objectstack/spec`, additive):**`RenderTemplateInput.previewDrafts?`, `RenderTemplateResult.resolved?` and the new `RenderedTemplateVersion` type. `SendTemplateInput` is unchanged, and `sendTemplate` never reads a draft, even when its input object carries the key.
18
+
-**`@objectstack/plugin-email`:**`renderTemplate` sets `resolved` on every render; `TemplateLoadOptions.previewDrafts?` and `EmailTemplateRow.draft?` carry the draft read through the registry loader. A replacement `TemplateLoader` that ignores the option renders the published row, labelled published.
docs(skills): the automation skill says an assignment rule tells nobody, and gives the creation flow that tells the person it picked
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
Skills-docs: updated here
10
+
11
+
`skills/objectstack-automation/references/examples-flows.md` § Assignment rules gains the recipe. An assignment rule writes `owner_id` and `queue` and nothing else, and no key on a rule or an entry notifies, so the person a `round_robin` or `least_loaded` entry picks is told by a flow on the object's creation: a `record-after-create` start node with the condition `!isBlank(record.owner_id) && record.owner_id != record.created_by`, then a `notify` to `record.owner_id`. A parked record (an entry with no `strategy`, or a queue nobody staffs) has no owner, so nobody is told; a signed-in creator owns what they file and is not told of it. The section links the guide's whole flow.
12
+
13
+
No runtime or contract change: the skill now teaches what the platform already does. One eval case in `evals/flows-triggers-approvals.json` asks for the routing and the notice together, and fails an answer that puts a notify key on the rule. Eval 12 of the same file (round-robin routing plus a queue sign-off) stops forbidding `record-after-create`, the trigger the section now teaches for the notice, and forbids `owner_id:` instead, the key a flow writes when it routes the record itself. Its case hash is new, so `skill-evals --regrade` sets it apart from a round recorded before this change: compare it across rounds only after a re-run.
14
+
15
+
The recipe is paid for in the same file by cutting sentences `SKILL.md` already says: the file goes from 26505 to 26508 bytes and stays at its token ceiling.
0 commit comments