Logic and automation
Multilingual documents and email delivery
Render localized templates as HTML or PDF and deliver them through a tenant-registered email provider.
Pikbase provides the tenant runtime for template storage, language selection, rendering, PDF generation, attachment assembly, and email execution. Workspaces can use limited platform email delivery before configuring their own SMTP provider.
Email without workspace SMTP
Without workspace SMTP, only templates included with the workspace can be used for email delivery. Pikbase uses its original versions, not the workspace's edited copies. Saving or pushing changes to an included template does not change emails sent through platform delivery. Custom templates require workspace SMTP.
Configure your provider in Workspace > Settings > SMTP, or use gsb settings smtp, to use your own templates and edits in outgoing email. Configuration is not proof of successful delivery: verify your provider's sender requirements and test an email after setup. These restrictions concern email delivery, not standalone HTML or PDF generation.
Application content management
The multilingual infrastructure is not limited to documents. Model application content as ordinary entities and mark localized properties as multilingual. When an application calls setGsbLangCode with the user's selected language, the Core client persists that choice and automatically adds it as variation.langCode on subsequent tenant requests. Entity Service returns the matching language variant, so navigation, catalog content, articles, help text, and other CMS-managed content use the same governed data contract as the rest of the application. A caller can override the language for an individual request when needed.
Multilingual templates
A GsbDocTemplate can store one HTML body or multilingual content keyed by language code, including en_us, tr_tr, de_de, fr_fr, es_es, and other supported variants. Template expressions bind entity, workflow, contact, and parameter data at render time. The renderer selects the language variant from the explicit langCode or the active request/workflow variation.
HTML and PDF generation
Use workflow-function operation type 12 to render PDF from inline HTML or a stored document template. The operation configuration belongs under docTemplate.
For inline content, put the HTML in docTemplate.template; this field is HTML, not a template ID. A stored template reference belongs at docTemplate.docTemplate.id:
{
"orderNumber": 1,
"operationType": 12,
"title": "Generate password-reset document",
"docTemplate": {
"docTemplate": {
"id": "replace-with-your-tenant-template-id",
"title": "Forgot Password"
},
"urlParam": "instanceprms",
"propertyName": "",
"fileNameProp": ""
}
}
Stored template IDs are tenant-specific. Replace the sample ID with the ID of a GsbDocTemplate in the tenant where the function will run.
testWfFunction accepts the supplied function definition and instance as one request object:
const operation = {
orderNumber: 1,
operationType: 12,
title: "Generate PDF URL",
docTemplate: {
docTemplate: { id: "replace-with-your-tenant-template-id" },
urlParam: "documentUrl",
},
};
const operations = JSON.stringify([operation]);
const instance = { entity: {}, prms: {} };
const result = await entityService.testWfFunction({
function: { name: "PdfProbe", operations },
instance,
});
The other documented HTML source fields are htmlWfParam and htmlEntityParam; they were not part of the 2026-09-10 live verification. Choose an output according to the caller's next step:
| Field | Result |
|---|---|
propertyName |
Stores the generated file through a target entity property. |
urlParam |
Uploads the PDF and writes its URL to workflow parameters. No target entity is required for URL-only generation. |
byteArrParam |
Writes encoded PDF content to workflow parameters for in-memory use. |
fileNameProp |
Names the entity property whose value supplies the generated filename; it is not a literal filename. |
The UI label Upload URL WF Param serializes as docTemplate.urlParam, not an uploadurlwfparam wire field. A raw result may expose generated parameters in top-level prms while instance.prms is empty:
{
"success": true,
"status": 0,
"prms": {
"documentUrl": "https://storage.example.com/documents/generated.pdf"
},
"instance": {
"entity": {},
"prms": {}
}
}
The URL is illustrative. Use the explicit success flag to determine the outcome; do not treat status: 0 as failure when success is true.
On 2026-09-10, live dev1 testWfFunction checks rendered the same inline HTML with usePuppeteer: true and false. Both returned backend HTTP 200 and a valid, visually checked, single-page 16,536-byte PDF. This does not establish that the two settings use distinct renderer implementations. The earlier spawn /usr/bin/chromium ENOENT incident is historical, not the current availability state.
The verified byteArrParam output decoded as an outer base64 value containing a JSON string whose content was the base64 PDF; validate and decode that shape rather than assuming an array. testWfFunction is not necessarily side-effect free: urlParam creates a cloud artifact, and existing invoice wrappers can delete prior files before replacement. Use isolated fixtures and explicit cleanup for live checks.
Template email
The email function resolves the recipient language, renders the selected document template, translates the subject, and sends HTML or text content. Email operations support To, Cc, Bcc, Reply-To, priority, distinct delivery, and file attachments.
Generated PDF attachments
In a function or workflow, generate the localized PDF first and pass the resulting file to the following email operation as an attachment. The document and message can use the same language context and entity data, keeping invoices, statements, confirmations, and notices consistent. PDF generation success does not prove attachment mapping: declarative email operation type 13 still requires separate repair and validation for PDF attachments.
Register a delivery provider
Configure workspace SMTP with the provider account, sender identity, server, port, TLS, and credentials required by that provider. Credentials remain in protected tenant runtime settings. Pikbase supplies rendering, orchestration, attachment handling, retry-capable SMTP delivery, and execution logs. You and your provider must meet the applicable sender verification, reputation, quota, and transport requirements.
Pikbase docs