Admin Tool Templates

Introduction to Templates in the Admin Tool

In ConSol CM, several types of templates are used:

In this chapter, the general templates in the Scripts & Templates Administration of the Admin Tool are explained.

Admin Tool templates are written using FreeMarker notation (see FreeMarker web site) and should only be edited by experienced ConSol CM consultants and administrators. A ConSol CM standard installation already contains system templates and some example templates which might help you, as an administrator, to define new templates for your special use cases.

The Admin Tool Template Editor

To work with templates, open the navigation item Scripts and Templates in the navigation group System and switch to the Template tab.

In the templates list, all templates are listed with:

To open a template in the editor panel, mark it in the list and open it by clicking the Edit button. Each template must have a name, whereas the group name is optional.

If your system works with various languages, you can define each template for each language. Use the drop-down menu Language above the editor panel. The Web Client will display the template for the configured locale of the web browser. If there is no template for this language, the default language will be used. Every template has to be defined for the default language.

Figure 341: ConSol CM Admin Tool - Template editor

Working with Admin Tool Templates

The Admin Tool templates represent a template pool. Each template can be referenced from different modules of the system and is always referenced by its name. In the following paragraphs, all modules where templates can be used are explained. Within a template, the Data Object Group Fields, Resource Fields, and Custom Fields are referenced by group name and field name, e.g., the company name within the Data Object Group ResellerCompany is referenced as shown in the following example.

${ResellerCompany.getFieldValue("ResellerCompanyData","company_name")!}

For a detailed explanation of working with Custom Fields, please see section Custom Field Administration (Setting Up the Ticket Data Model). Data Object Group Fields are explained in section Setting Up the Customer Data Model. Resource Fields are explained in section CM.Resource Pool - Setting Up the Basic Resource Model.

Do not use line breaks in template statements!

System Templates

A default ConSol CM installation comes with several system templates. They are used in standard situations like error messages sent to an administrator. Please see the following list for an overview of the system templates:

Templates for Definition of Customer Format in the Web Client

The appearance of customer data (e.g., name, phone number, and room number or surname and forename only) in different sections of the Web Client can be formatted using templates. The definition has to be made for each data object (i.e., for each company definition and for each contact definition) so that specific templates can be used within each customer group. The configuration of templates for data objects is explained in section Templates for Customer Data.

The same principle applies to the representation of resource data (if CM.Resource Pool is active in your ConSol CM system). For a detailed explanation, please refer to section CM.Resource Pool - Templates for Resource Data.

In the following example, the customer data within the ResellerCustomer data object should be represented in the standard template with forename and surname.

Figure 342: ConSol CM Admin Tool - Example of a customer format definition template

<#if ResellerCustomer.getFieldValue("ResellerCustomerData","customer_name")?has_content && ResellerCustomer.getFieldValue("ResellerCustomerData","forename")?has_content>${ResellerCustomer.getFieldValue("ResellerCustomerData","customer_name")!},${ResellerCustomer.getFieldValue("ResellerCustomerData","forename")!}<#else> ${ResellerCustomer.getFieldValue("ResellerCustomerData","customer_name")!}</#if>Search for contacts of a certain company

Code example 69: Customer format definition template

Figure 343: ConSol CM Web Client - Example of a customer format definition template

Ticket Assignment Templates

In the queue administration (see section Queue Administration), ticket-engineer-assignment templates can be selected. There are templates for the use cases assign and remove.

You have to write and save the templates here in the Template section first. Then they will be available in the drop-down menu in the Ticket assignment templates section of the queue administration (see section Queue Administration). You can define a name of your choice - we recommend using a name which describes the use of the template, as shown in the following example.

Figure 344: ConSol CM Admin Tool - Example of an e-mail template for ticket assignment to an engineer

Subject: Ticket #${ticket.name} assigned to you

 

<#setting number_format="0.######"/>

The ticket #${ticket.name}

 

"${ticket.subject}"

 

has been assigned to you by <#if engineer_exec??>${engineer_exec.name}<#else>the workflow</#if> <#if engineer_old??>(former engineer: ${engineer_old.name})<#else>(no former engineer)</#if>

 

Please take care.

 

URL: http://localhost:8080/cm-client/ticket/name/${ticket.name}

Code example 70: Text of the example template engineer-assigned-default-mail

Figure 345: ConSol CM Admin Tool - Configuration of a ticket assignment template for a queue

Password Reset Templates

When users forgot their passwords, they can request a new password using ConSol CM standard functionality. The user might be an engineer who works with the Web Client or a customer who has a login to CM.Track. For both cases, the administrator has to configure ConSol CM in a way that an e-mail can be sent to the user who needs a new password. This e-mail is based on a template which is stored in the Admin Tool, in the Template section.

Password Reset Template for Engineers in the Web Client

When an engineer has forgotten his Web Client password, he can request a new password by using the link Forgot your password? on the initial login page. An e-mail with a link to an URL where the engineer can set the new password is sent to the engineer.

Please note that this can only work if a valid e-mail account is available for this engineer and if the respective value has been entered as e-mail address for the engineer in the engineer data!

The e-mail which is sent to the engineer is based on the template password-reset-template. This template name is mandatory, required for the password to work. The template could look like the following example:

Subject: Password reset procedure

 

<#setting number_format="0.######"/>

To reset your password please click the following link:

 

http://localhost:8888/cm-client/passwordChange?resetCode=${resetCode}

 

This link expires at ${expirationDate?string("yyyy.MM.dd HH:mm:ss")}.

Code example 71: Template to reset the engineer's password

Figure 346: ConSol CM Web Client - Password reset by an engineer

Please note that the password reset in the Web Client is only possible if the standard mode is used. It is not possible if LDAP or Kerberos authentication is in operation. See section Authentication Methods for Engineers in the Web Client for an explanation of all possible authentication modes.

Password Reset Template for Customers Using CM.Track V1

When a customer has forgotten his CM.Track password, he can request a new password by using the link Forgot your password? on the initial login page. An e-mail with a link to an URL where the customer can set the new password is sent to the customer. Currently (June 2016), this functionality is available in CM.Track V1, not yet in V2.

Please note that this can only work if a valid e-mail account is available for this customer and if the respective value has been entered as e-mail address for the customer in the respective Data Object Group Field.

The e-mail which is sent to the customer is based on the template track-password-reset-template. This template name is mandatory, required for the password to work. The template has to be created/added manually, it will not be present in the system by default.

The template should be formatted like the following example (you can add any text you would like to send to your customers, but please note the resetCode variables and the URL!):

Your Password Reset Link:

http://mycm6system/cm-track/#track=set_new_password/resetCode-${resetCode}(Reset Code: ${resetCode})

Valid 24 hours only, please visit before expiry!

Code example 72: Reset the password of a customer in CM.Track

As FROM-address for the e-mail to the customer, the administrator e-mail address is used.

Figure 347: CM.Track - Password reset by a customer

Please note that the password reset in CM.Track V1 is only possible when the DATABASE mode is used. It is not possible when LDAP authentication is in operation. See section CM.Track V1: Authentication Modes for the Portal for an explanation of all possible authentication modes.

Custom Defined Templates

A ConSol CM administrator or workflow developer can define any template that is required and store it in the Scripts & Templates Administration. When used in automatic e-mails which are sent by a workflow activity, you can always use the workflow API renderTemplate() method to reference a template. However, most e-mail templates should be managed using the Text Template Manager (see section The ConSol CM Text Template Manager). There are only very few use cases which might require that e-mail templates, or parts of e-mail templates, have to be stored in the Scripts & Templates Administration of the Admin Tool.