If you need documents for customs, couriers, or customers, such as sales receipts, delivery documents, invoices, etc., you can create templates for them and print them when needed.
How to create a template
Go to «Settings» → «Advanced» → «Document Templates», where you will see a list of created templates.
To add a new one, click «Add template»:
In the window that opens:
-
Title — enter a name that is understandable to employees;
-
Template type — select «Order»; if the template is only needed for deliveries, select «Deliveries»; if it is needed for pipeline cards, select «Pipelines»;
-
Insert field — a list of all available variables that can be added to the template; they match the fields from the order, buyer, and company. When you click, the selected field variable is immediately added to the code and will be replaced with data from this field when the document is generated;
-
Preview as PDF — click to see how the finished document will look when printed.
-
Preview — click to quickly view the changes made to the code.
-
Code input field — add the code for your document. HTML, CSS, and Twig are supported.
When you are ready, click the «Save» button. The created template will appear in the list and will be available for printing.
How to enter your data into a ready-made template
First, select and copy the template code from our document library. Delete all code from the input field and paste the copied code.
When viewing, you will see that some text is highlighted in yellow. You need to find it in the template code and replace it with your data. After that, the preview will display what you have entered:
When everything is ready and you are sure that everything is displayed correctly, you need to remove the text highlighting, otherwise it will be preserved during printing.
To do this, find all lines style="background-color: yellow"
and remove them:
After removing the highlight, open the preview to make sure that nothing is broken and everything is displayed correctly.
Click «Save» to add the template and save all the data you have entered.
How to add your logo, signature, and other images to a document
To add an image, you need to have a direct link to the file extension. Make sure that this link opens the image in your browser, for example: https://blog.keycrm.app/keycrm/images/keycrm-logo-blue-on-white.png
.
You can get the link by:
-
Uploading the logo in the «Settings» → «General» section and copying it via the context menu.
-
Placing the image on your server or website.
-
Using photo hosting services, such as postimages.org.
To insert an image into a document, use the following code:
<img src="https://blog.keycrm.app/keycrm/images/keycrm-logo-blue-on-white.png" style="width: 200px;">
-
src — link to the image (URL). Here you need to specify the path to your image;
-
style — style parameter, for example,
width: 200px;
sets the width of the image. You can change the value depending on your needs.
If you need to replace the image, replace the link inside the quotation marks in src="your link"
.
How to add document templates to the shipping service
Templates created with the «Delivery» type can only be printed after creating a waybill via KeyCRM.
To make them available, you need to add the delivery service you will be using. To do this:
-
Go to the settings of the integrated delivery service;
-
Open the «Documents» tab and select the required ones in the «Document templates» field.
Click «Save». From this point on, the selected documents will be available for printing for all new waybills created for this delivery service.
Template management
The list of templates displays their names and types. By clicking on the table column names, the list is sorted, and you can:
- Enable/disable a template by clicking on the switch in the “Status” column;
- Rename and make changes to the code by clicking on the pencil icon, which will open the same window as when creating a template;
- Delete an unused document template by clicking on the bin icon.
Using ready-made templates, available variables, and twig functions, you can customize your own document templates and print them during the process.