Skip to content

Configuring Templates v2

Configuring templates v2 according to your needs usually comprises the following tasks:

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.

  1. 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.

  2. Click Page Layouts.

  3. Click Page Layout Assignment, then Edit Assignment.
  4. Select the target user profile(s) in the table.
  5. From the Page Layout To Use picklist, select Template Layout v2 to be assigned.
  6. 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:

  1. Create a new template, clone an existing template, or open an existing template.
  2. In the Layout & Design section, double-click the PDF Renderer field and specify the value v2.
  3. 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:

    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 to Liquid Template. The picklist value Liquid Template may not be available in your org. In this case, add it to the value picklist for the Type 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)

    Swiss QR Code Invoice Template (English)
    Swiss QR Code Invoice Template (German)

  4. In the Layout & Design section, double-click 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 and percent 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 or false.
    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 to en-EN if not set.

  5. Optionally, define a page header and footer.

    In the Header & Footer section, double-click the Page Header or Footer 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>
      
  6. 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:

  1. Open the template to be edited.
  2. In the Information section, double-click the Counter field and specify the counter as required.

    Alternatively, you can click Edit in the detail view to edit the field.

  3. Click Save.

Info

Counters defined on templates overwrite counters defined for business entities.

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.

  1. Open the template to be edited.
  2. In the Payment Information section, double-click 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.

  3. 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 (see Distributing Invoices). 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.
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. Note that this address must be available as an organization-wide email address.
Email Subject Defines the default email subject. Can include placeholders, like Invoice: [InvoiceNo] (default).
Email Body Defines the plain text body for the email. Can include placeholders, and line breaks are considered.
Make sure that the email text includes the placeholder [InvoiceLink] (up to JustOn 2.48) or [PaymentLink] (as of JustOn 2.49) for the recipients to be able to access the invoice page or, respectively, the payment page of the JustOn Self-Service Extension.
Email HTML Body Defines a rich HTML body text for the email. The editing area of this field includes an inline HTML editor.
Make sure that the email text includes the placeholder [InvoiceLink] (up to JustOn 2.48) or [PaymentLink] (as of JustOn 2.49) for the recipients to be able to access the invoice page or, respectively, the payment page of the JustOn Self-Service Extension.

Note

Email Body is ignored if there is content in Email HTML 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?.

To edit the email contents:

  1. Open the template to be edited.
  2. Click Edit.
  3. In the Email Text section, modify the fields as required.
  4. Click Save.

Info

Template text blocks can contain

  • plain text
  • placeholders
  • HTML code for tables, lists, links, etc.

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.