Configuring Liquid Templates
Configuring templates based on the Liquid template language according to your needs usually comprises the following tasks:
- Enabling Template Layout v2
- Configuring Liquid template rendering
- Specifying counter
- Specifying default payment due
- Configuring payment reference text for SEPA Direct Debit or SEPA Credit
- Modifying invoice email
Info
For topics beyond the scope of the usual template configuration, refer to our FAQ section PDF and Email.
For further help with template customization, contact JustOn Support.
Enabling Template Layout v2
JustOn recommends to enable the Template Layout v2 when working with templates that base on Liquid files.
-
Navigate to the object management settings of the Template object.
Click to open the Setup menu and select Setup, then open Objects and Fields > Object Manager > Template.
-
Click Page Layouts.
- Click Page Layout Assignment, then Edit Assignment.
- Select the target user profile(s) in the table.
- From the
Page Layout To Use
picklist, selectTemplate Layout v2
to be assigned. - Click Save.
For details, see Assign Page Layouts from a Customize Page Layout or Record Type Page in the Salesforce Help.
Configuring Liquid Template Rendering
Preparing your templates to use the JustOn PDF service involves the following steps:
- Create a new template, clone an existing template, or open an existing template.
- In the Layout & Design section, click
next to the
PDF Renderer
field and specify the valuev2
. -
Attach the required Liquid template files.
In the Notes & Attachments area, click to open the action menu, select Upload Files, then proceed as prompted.
This operation requires the custom
Type
field (ONB2__Type__c
) to be available on the page layout of the Content Version object. For details about adding fields to page layouts, see Modifying Page Layouts or Search Layouts.To cover all use cases, the following Liquid templates are required:
Liquid Template Title Used for Invoice Template
invoices, credits, cancellations, pro forma, deposit Dunning Template
all dunning levels Account Statement Template
account statements Make sure to set the
Type
of the uploaded files toLiquid Template
. The picklist valueLiquid Template
may not be available in your org. In this case, add it to the value picklist for theType
field of the Content Version object. For details, see Modifying Picklist Values.Example Liquid templates
Invoice Template (English)
Dunning Template (English)
Account Statement Template (English)Invoice Template (French)
Dunning Template (French)
Account Statement Template (French)Invoice Template (German)
Dunning Template (German)
Account Statement Template (German)Swiss QR Code Invoice Template (English)
Swiss QR Code Invoice Template (German) -
In the Layout & Design section, click next to the
PDF Options
field and specify options for the PDF output as required.The field value is in JSON notation and sets optional properties for the
decimal
,currency
andpercent
Liquid filters.Property Description locale
Sets the language code. currencyDisplay
Defines the currency display format. Possible values include symbol
,code
,name
.useDigitGrouping
Toggles the digit group separator. Possible values include true
orfalse
.minimumFractionDigits
Sets the minimum number (Integer) of decimal places. maximumFractionDigits
Sets the maximum number (Integer) of decimal places. JustOn recommends to set at least the
locale
property. It defaults toen-EN
if not set. -
Optionally, define a page header and footer.
In the Header & Footer section, click next to the
Page Header
orFooter
field and specify the information as required.Page header, footer and page counters must be addressed using specific CSS classes. You may use the following code as a starting point for your customization:
-
Page header
<div class="page-header" style="width:90%; text-align:center; font-size:10pt;"></div>
-
Footer
<div class="page-footer" style="width:90%; text-align:center; font-size:10pt;"> Page <span class="pageNumber"></span> of <span class="totalPages"></span> </div>
-
-
Click Save to apply your template customization.
Specifying Counter
Invoices, credits, cancellations and dunnings must have unique numbers to comply with legal regulations. In Draft
status, these numbers are temporary and of no legal relevance. When setting them to Open
, however, JustOn creates the unique and unalterable numbers for invoices, credits, cancellations and dunnings based on defined counters. For details, see Counters and Number Ranges.
Customizing templates therefore involves specifying the counter to be used. To do so:
- Open the template or template detail to be edited.
-
In the Information section, click next to the
Counter
field and specify the counter as required.Alternatively, you can click Edit in the detail view to edit the field.
-
Click Save.
Info
Counters defined on templates overwrite counters defined for business entities.
Specifying Default Payment Due
Depending on your business requirements, you can specify the number of days that is added to the invoice date by default in order to calculate the payment due date of the invoice. To do so, you configure the template field Default Payment Due
.
- Open the template to be edited.
- In the Payment Information section, click
next to the
Default Payment Due
field and specify the required number of days. - Click Save.
Info
A default payment due set on the account takes precedence. If you have not set a default payment due on the account or the template, JustOn defaults to 0
.
Configuring Payment Reference Text
Depending on your organization's requirements, you specify a string that is to be written as the payment reference for SEPA payments. To do so, you configure the template field Payment Reference
.
- Open the template to be edited.
-
In the Payment Information section, click next to the
Payment Reference
field and modify the information as required.Modify the default value
[InvoiceNo] - [InvoiceDate]
as necessary.You can use the placeholders that are available for the invoice context.
-
Click Save.
Modifying Invoice Email
In addition to the fields that are printed to the PDF, the invoice template also includes texts for the email that JustOn can send to distribute the rendered PDF documents. These fields include:
Template Section | Field | Description |
---|---|---|
Email Text | PDF Name | Specifies the name for the generated PDF file. It can contain placeholders, the default is [InvoiceDate]_[InvoiceNo]_[AccountName].pdf . The allowed characters include the alphanumeric characters a-z A-Z 0-9 as well as the underscore _ and hyphen - characters. |
Attach Files To Outgoing Email (checkbox) | Controls whether attached files are included in any outgoing email. | |
Email File Types | Defines which file types will be attached to emails (comma separated list of file extensions). For example, pdf,csv sends all PDF and CSV files; if empty (default), all files files are attached except for transaction table HTMLs. |
|
Email Sender | Defines an email sender address, must be available as an organization-wide email address. Takes precedence over the email sender address set on the business entity. |
|
Email Subject | Defines the default email subject. Can include placeholders, like Invoice: [InvoiceNo] (default). |
|
Email Body | Defines the plain text (or HTML source code) body for the email. Can include placeholders, and line breaks are considered. Make sure that the email text includes the placeholder [PaymentPageURL|no-persist] for the recipients to be able to access the payment page of JustOn Cash Management. |
|
Email HTML Body | Defines a rich HTML body text for the email. The editing area of this field includes an inline HTML editor. Must not include HTML source code. If you want to use HTML source code for preparing the email body, you use the field Email Body .Make sure that the email text includes the placeholder [PaymentPageURL|no-persist] for the recipients to be able to access the payment page of JustOn Cash Management. |
Note
Be aware of the following specifics:
Email Body
is ignored if there is content inEmail HTML Body
.- You must use either
Email Body
orEmail HTML Body
in both the template and its associated template details. Email HTML Body
must not include HTML source code. If you want to use HTML source code for preparing the email body, you use the fieldEmail Body
.
Info
If you send email with non-Latin data, like the Euro symbol, Hebrew, Chinese, Japanese, Russian, etc., set your email encoding to Unicode (UTF-8)
. For details, see Why do PDF files or emails contain garbage characters?
If you specify a company signature in the email body, consider disabling user signatures. For details, see Why do emails include two signatures?
To edit the email contents:
- Open the template or template detail to be edited.
- Click Edit.
- In the Email Text section, modify the fields as required.
- Click Save.
Info
Template text blocks can contain
- plain text
- placeholders
- HTML code for tables, lists and links
If you use HTML code in template text blocks, make sure to write all code in a single line to avoid line breaks being converted to <br/>
tags.
Displaying QR Codes
In order for invoice recipients to make use of QR codes to initialize payments, the printed invoices must include the QR codes. To this end, you must configure the relevant invoice template accordingly.
To prepare a template that uses the JustOn PDF service to include SCT QR codes:
-
Prepare a template to use Liquid templates and the JustOn PDF service.
For details, see Configuring Liquid Template Rendering.
-
In the attached Liquid template file for invoices (most likely, Invoice template.liquid), add the tag for embedding the produced QR code image in an appropriate section.
Use the following code:
<img class="qrcode-payment" src="{{QrCode.DataURI}}">
For details on working with Liquid files, see Working With Liquid Code.
-
In the
Add QR Code
field of the template, selectSCT QR Code
. - Optionally, specify options for the PDF output or define a page header and footer as required.
- Click Save.