Templates
this documentation is intended for the development of custom themes and their templates in sparklayer you can learn more here https //docs sparklayer io/templates templates available templates template type description invoice liquid pdf invoice pdf template quote liquid pdf quote pdf template limited user purchase review\ liquid email notification of a new purchase placed by a limited user for review limited user purchase approve liquid email notification of a new purchase placed by a limited user approved new quote notification to merchant liquid email notification of a new quote placed by a customer quote assigned notification to agent liquid email notification of a quote assigned to an sales agent purchase history message notification to agent liquid email notification of a message on a purchase history to a sales agent purchase history message notification to customer liquid email notification of a message on a purchase history to a customer email header liquid section re usable email header section email footer liquid section re usable email footer section note only the above templates can be used, any other files uploaded to a theme are discarded, including supporting files such as images and fonts template markup & liquid templates are written in liquid https //shopify github io/liquid/ and have access to the majority of liquids tags and filters we also have some additional helper filters documented below styling must be added in the template using either the style html element, or inline styles note however all styles are inlined when rendering the template for better compatibility with email clients the email templates provided have been tested in modern web based email clients such as gmail, however we don't offer support for older email clients such as desktop variations of outlook we recommend using testing your custom email templates as they can be particularly problematic with modern html and css filters & blocks currency docid\ e4734072dcc5ffed3d25cb5bc03c0073cd329dcbtranslate docid\ e4734072dcc5ffed3d25cb5bc03c0073cd329dcblocalised date format docid\ e4734072dcc5ffed3d25cb5bc03c0073cd329dcbcountry from country code docid\ e4734072dcc5ffed3d25cb5bc03c0073cd329dcbtemplate sections docid\ e4734072dcc5ffed3d25cb5bc03c0073cd329dcb currency monetary values should use the currency filter in a template to properly render the currency and its appropriate formatting based on locale {{ "9 99" | currency "gbp" }} \ £9 99 you can also change the currency formatting with one of the following three options display none display code display symbol (default) {{ "9 99" | currency "gbp", "display code" }} \ gbp 9 99 note this filter also has a shorthand alias c which works the same translate internationalisation can be supported in templates using the translate filter a theme will need to have the appropriate language file with the desired translation strings documentation on theme language files can be found here docid\ e4734072dcc5ffed3d25cb5bc03c0073cd329dcb { "example" { "heading" "welcome to sparklayer!" } } {{ "example heading" | translate }} note this filter also has a shorthand alias t which works the same language strings can support interpolation by providing slots in the string, and arguments to the translate filter like so { "example" { "heading" "dear ${1} of ${2}" } } {{ "example heading" | translate "jeremy sparks", "sparklayer" }} this filter uses the store locale from the merchant core data to translate, falling back on the en translation file if no translation is found for the respective locale localised date format localised date formatting is supported with the ldate filter by default, this filter uses the stores locale, provided in the merchant core data, but an optional locale parameter can be provided and used instead {{ "2024 10 22t16 18 02 196z" | ldate }} \ 22/10/2024 with a provided locale {{ "2024 10 22t16 18 02 196z" | ldate "fr ca" }} \ 24 10 22 country from country code country names can be rendered from the country code using the country filter this is helpful for address data where the country code is stored instead of the country name {{ "gb" | country }} \ united kingdom note that country names are only returned in english despite the stores locale template sections we have limited support template sections with the section tag the available section templates are documented above under templates docid\ e4734072dcc5ffed3d25cb5bc03c0073cd329dcb , and we do not support custom sections outside of these \<main> {% section email header %} \<p>content\</p> {% section email footer %} \</main> \ \<main> \<header> \<h1>hello world\</h1> \</header> \<p>content\</p> \<footer>copyright year\</footer> \</main> internationalisation & translations language json files can be added to themes for internationalisation in templates the language file must be named using a language code (i e en , fr , etc ) and should match the locale used by your store the translations in these files are available through the translate docid\ e4734072dcc5ffed3d25cb5bc03c0073cd329dcb liquid filter by default, the filter will use the stores locale, falling back on sparklayers own core language files if no translations in your custom language files are found, with en being the final fall back available data templates have a range of data available to them via the data liquid variable, for example data merchant store name template top level objects invoice liquid template objects docid\ qbltubvxaqdumbwcnlxar , template objects docid\ qbltubvxaqdumbwcnlxar , template objects docid\ qbltubvxaqdumbwcnlxar quote liquid template objects docid\ qbltubvxaqdumbwcnlxar , template objects docid\ qbltubvxaqdumbwcnlxar limited user purchase review\ liquid template objects docid\ qbltubvxaqdumbwcnlxar , template objects docid\ qbltubvxaqdumbwcnlxar limited user purchase approve liquid template objects docid\ qbltubvxaqdumbwcnlxar , template objects docid\ qbltubvxaqdumbwcnlxar new quote notification to merchant liquid template objects docid\ qbltubvxaqdumbwcnlxar , template objects docid\ qbltubvxaqdumbwcnlxar quote assigned notification to agent liquid template objects docid\ qbltubvxaqdumbwcnlxar , template objects docid\ qbltubvxaqdumbwcnlxar , template objects docid\ qbltubvxaqdumbwcnlxar purchase history message notification to agent liquid template objects docid\ qbltubvxaqdumbwcnlxar , template objects docid\ qbltubvxaqdumbwcnlxar , template objects docid\ qbltubvxaqdumbwcnlxar purchase history message notification to customer liquid template objects docid\ qbltubvxaqdumbwcnlxar , template objects docid\ qbltubvxaqdumbwcnlxar , template objects docid\ qbltubvxaqdumbwcnlxar email header liquid template objects docid\ qbltubvxaqdumbwcnlxar email footer liquid template objects docid\ qbltubvxaqdumbwcnlxar while this data can vary from template to template, they all have access to the store details ( data merchant ) template objects docid\ qbltubvxaqdumbwcnlxar contains the stores general information, and can be changed via the sparklayer dashboard learn more here https //docs sparklayer io/dashboard configurations# soyd more information about the objects and their properties can be found in the template objects docid\ qbltubvxaqdumbwcnlxar documentation