cmRichTextEditor

This type allows to configure the rich text editor.

Attributes:

Using a script to configure settings

Instead of providing the values for the attributes directly in the page customization, you can reference a script which returns the desired values. This allows you to add logic when determining the editor settings. You need to create a script of the type Page customization and reference it in the configuration script field of the page customization.

Example:

The default font size should depend on the customer group of the case’s main contact. You can reference a script with the following code.

ticket = ticketService.getById(ticketId);

def mainContact = ticket.mainContact

def cgName = mainContact.customerGroup.name

switch(cgName) {

case "DirectCustomers": [fontSizeValue:"14pt"];

break;

case "Reseller": [fontSizeValue:"12pt"];

break;

default: [fontSizeValue:"10pt"];

break;

}

Code example 40: Script to set the default font size for the rich text editor depending on the customer group of the case’s main contact