Templates

Splynx has set of templates that are used in different parts of the system. Email messages, Invoice PDFs, SMS messages, Document templates etc.

Categories of templates

  • Customer portal – messages sent to customer portal
  • Invoice PDF – Invoices (customer billing)
  • Mail – messages sent to email
  • SMS – messages sent to SMS
  • Documents – Documents (located on customer)
  • Cards – Generation cards (prepaid, refill)
  • Payment calendars – payment calendars (customer billing)
  • Payment receipts – receipts for payments (customer billing)
  • Request PDF – proforma invoices – requests (customer billing)
  • Reminder mail – reminder mail notification (customer billing)
  • Reminder SMS – reminder sms notification (customer billing)
  • Finance exports – Export invoices, requests, payments on Finance part

Add a new template

How to add a new template: Settings Type of template

Edit

When you edit or change the template, Splynx displays you HTML editor:

Edit template

Delete

You can always delete the template:

Delete template

Values for templates

We recommend to create one test template in customer documents and enter the following values to get list of variables for section of Splynx that you need to use.

For example, let's create a test template and dump all variables of customer:

Generate document

And then we can get the list of variables:

["id"]=> string(2) "50"
["billing_type"]=> string(7) "prepaid"
["partner_id"]=> string(1) "4"
["location_id"]=> string(1) "1"
["added_by"]=> string(5) "admin"
["added_by_id"]=> string(1) "1"
["login"]=> string(6) "000050"
["category"]=> string(6) "person"

For example, If we need to use the value login of customer inside invoice PDF, just type:

some HTML code {{ login }} continues HTML code

Please find the list of most used variables here - Variables for templates.

There are dump commands for different Splynx sections below:

Basic system values:
{{ dump(loader.values) }}
Customer's information:
{{ dump(loader.customer) }}
General information:
{{ dump(loader.info) }}
Customer's services:
{{ dump(loader.services) }}
Get all Internet services that are Active:
{{ dump(loader.getServicesByTypeAndStatus('internet', 'active')) }}
Billing information:
{{ dump(loader.billing) }}

##### Partner:
```twig
{{ dump(loader.partner) }}
Transactions:
{{ dump(loader.transactions) }}
Invoices variables:
{{ dump(loader.invoices) }}
Invoice items:
{% for invoice in loader.getInvoices() %}
Invoice {{ invoice.number}} items:
{{ dump(invoice.items) }}
{% endfor %}
{{ dump(loader.invoices) }}
Pro-formas:
{{ dump(loader.requests) }}
Payments:
{{ dump(loader.payments) }}
Attached documents:
Invoices:
{{ dump(loader.getAttachedInvoices) }}
Pro-formas:
{{ dump(loader.getAttachedRequests) }}
Payment receipts:
{{ dump(loader.getAttachedReceipts) }}
Example of usage:
{% set attached_invoices = loader.getAttachedInvoices %}
{% for current in attached_invoices %}
Invoice number: {{ current.number }} - sum: {{ current.total }} 
{% endfor %}

Twig (engine)

In all templates we use twig engine, please find the documentation.