Read the source of a template
get_template_sourceRetrieve a template version’s HTML, CSS, settings, data, schema, translations, and checksum before editing; use the checksum as base_checksum when saving changes.
Instructions
Returns what a template version is made of: the body markup (html), css, head, settings (paper, margins, header, footer, fonts), sample data, data sets, data schema, translations and partials, with the version's checksum. Call it before save_template to change a template the user named, and save what you edited with that checksum as base_checksum. Reads the latest version by default, the newest draft a change builds on; published reads what renders use. Word and PowerPoint templates are documents: for them it returns the settings and data, not the document. Read-only and free.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| version | No | latest (default), published, a version number or a channel name | |
| template | Yes | Slug (e.g. invoice) or tpl_ id, as list_templates returns them |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| css | Yes | ||
| head | Yes | ||
| html | Yes | ||
| i18n | Yes | ||
| version | Yes | ||
| partials | Yes | ||
| settings | Yes | ||
| template | Yes | ||
| data_sets | Yes | ||
| data_schema | Yes | ||
| sample_data | Yes |