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
Split out of #10267, which fixed the template's locale and wrapped it in defineEmailTemplateDefinition. That card scoped the wiring question as separate and left it to the executing seat; this is that seat filing it rather than deciding it, because the wiring is not an addition.
The state today
examples/app-showcase/src/system/emails/index.ts declares showcase_task_done_email and objectstack.config.ts passes it through emailTemplates:, so it is materialized into sys_email_template at boot. Nothing sends it — showcase_task_completed ("Notify on Task Completed") is the flow its docblock names, and that flow's notify node uses the inline content path:
NotifyConfigSchema's superRefine (packages/spec/src/automation/io-node-config.zod.ts) refuses template combined with inline title/message outright:
template cannot be combined with inline title/message — pick ONE content path
So referencing the template there is a substitution: title and message have to go. And message: '{summary}' is the only consumer of the summarize script node's outputVariable — which is precisely what that flow exists to demonstrate. Its own docblock says so:
A flow function is PURE: it takes inputs, RETURNS a value, and a later declarative node uses or persists it (#4396).
Wiring the template therefore trades a live demonstration of the script-node contract for a demonstration of the template path. Both are worth showing; the showcase currently shows one of them and declares the other without showing it.
Two further costs worth pricing before anyone picks an option:
The template's declared variables are title and project. The flow record carries project as a scalar id, and the flow's own comment notes that reaching through it needs expand: ['project'] on the start node — so a faithful templateData is a change to the start node too, not just the notify node.
Add a second flow that demonstrates the template + templateData path, leaving showcase_task_completed as the script-node specimen. Costs one more flow in the corpus; keeps both demonstrations.
Convert the existing notify node to the template path and move the summary text into the template bundle. Loses the script-node → later-node demonstration unless another node is added to consume {summary}.
Split out of #10267, which fixed the template's
localeand wrapped it indefineEmailTemplateDefinition. That card scoped the wiring question as separate and left it to the executing seat; this is that seat filing it rather than deciding it, because the wiring is not an addition.The state today
examples/app-showcase/src/system/emails/index.tsdeclaresshowcase_task_done_emailandobjectstack.config.tspasses it throughemailTemplates:, so it is materialized intosys_email_templateat boot. Nothing sends it —showcase_task_completed("Notify on Task Completed") is the flow its docblock names, and that flow's notify node uses the inline content path:Why this is a decision, not a mechanical edit
NotifyConfigSchema'ssuperRefine(packages/spec/src/automation/io-node-config.zod.ts) refusestemplatecombined with inlinetitle/messageoutright:So referencing the template there is a substitution:
titleandmessagehave to go. Andmessage: '{summary}'is the only consumer of thesummarizescript node'soutputVariable— which is precisely what that flow exists to demonstrate. Its own docblock says so:Wiring the template therefore trades a live demonstration of the script-node contract for a demonstration of the template path. Both are worth showing; the showcase currently shows one of them and declares the other without showing it.
Two further costs worth pricing before anyone picks an option:
titleandproject. The flow record carriesprojectas a scalar id, and the flow's own comment notes that reaching through it needsexpand: ['project']on the start node — so a faithfultemplateDatais a change to the start node too, not just the notify node.@objectstack/plugin-emailregistered; without it the email channel returnsTEMPLATE_UNSUPPORTED. The showcase does not install it as a runtime plugin (app-showcase's email template declareslocale: 'en', which noen-USsend can resolve — and it bypassesdefineEmailTemplateDefinition#10267 added it only as a test-time devDependency).Options
template+templateDatapath, leavingshowcase_task_completedas the script-node specimen. Costs one more flow in the corpus; keeps both demonstrations.{summary}.locale: 'en', which noen-USsend can resolve — and it bypassesdefineEmailTemplateDefinition#10267 did as an interim), on the grounds that a materialized template is itself the thing being demonstrated — it is reachable fromservices.email.sendTemplateand from Studio, flow or no flow.No preference recorded here; #10267's surface was the declaration only. Filed unassigned.