We’ve developed some resources to help you work effectively from home during COVID-19 Click to learn more

Parser Variables

In this article

    Parser variables are the mechanism used by Customer Service to dynamically insert data into a text. It is used throughout the whole system. The syntax for a parser variable is the name of the variable enclosed by percentage characters. From version 7 we introdused the <cs:parser> </cs:parser> which all new templates will use. Mixing the old style (template variable enclosed in %) and the new style (template variable enclosed in <cs:parser>) of template variables is by default disabled. If you want to enable it you need to:

    1) Click the Source button while editing a Message
    2) Find the <body> tag
    3) Remove the cs:escape-percentages="" from the <body> tag and leave the rest untouched: <body cs:escape-percentages="" ... >

    With this change you are able to use both styles for template variables. Old templates are not automatically converted.

    In the following examples the old style is used, you may also use <cs:parser></cs:parser> in the HTML source instead of %%,

    One example would be Dear %customer.firstname%

     

    When this text is parsed, %customer.firstname% will be replaced by the first name of the customer. Be aware that you must know which context you are in to be sure that a parser variable is available. This document will describe where you can expect to find the different parser variables.
    Most of the parser variables consist of two parts separated by a dot. The first part is the entity and the second part is the attribute. In the above example we see that we are looking at a customer, and we are trying to get the "firstname" attribute of the customer. There are exceptions to this, where there is no entity present.

    Parser variables

    This section contains a list of the most common parser variables with a short description. It is divided into the entities as discussed above.
    You will see the notation like "customer." on some of the entities. This means that "" should be replaced by the name of the extra field configured for the entity.

    Customer

    customer.id The internal database id of the customer
    customer.name Firstname + lastname of the customer
    customer.bestName Same as customer.name, but will give the username if customer.name is empty
    customer.firstname The first name of the customer
    customer.lastname The last name of the customer
    customer.phone The phone number of the customer
    customer.cellphone The cell phone number of the customer
    customer.note The note field of the customer
    customer.username The user name of the customer
    customer.password The password of the customer, may be in encrypted form, depending on the configuration of the system
    customer.email The primary email address of the customer
    customer.deleted Gives 0 if not deleted and 1 if deleted
    customer.ourContact The id of the user set as "our contact"
    customer.language The language code for the customer customer.
    customer."" Any extra field on the customer

    Company

    company.id The internal database id of the company
    company.namae The name of the company
    company.note The note field of the company
    company.domain The domain names of the company, separated by comma
    company.phone The phone number of the company
    company.fax The fax number of the company
    company.adr The address of the company
    company.ourContact The id of the user set as "our contact"
    company.primaryContact.id The id of the customer set as the primary contact
    company.primaryContact.email The email address of the customer set as the primary contact
    company. Any extra field on the company

    Request/ticket

    ticket.id The request number of the ticket
    ticket.title The title of the ticket
    ticket.createdAt The date and time when the ticket was created
    ticket.createdAtRaw The date and time when the ticket was created in raw format
    ticket.lastChanged The date and time when the ticket was last changed
    ticket.lastChangedRaw The date and time when the ticket was last changed in raw format
    ticket.readByOwner The date and time when the ticket was read by the owner
    ticket.readByOwnerRaw The date and time when the ticket was read by the owner in raw format
    ticket.readByCustomer The date and time when the ticket was read by the customer
    ticket.readByCustomerRaw The date and time when the ticket was read by the customer in raw format
    ticket.activate The date and time when a postponed ticket should be activated
    ticket.closedAt The date and time when the ticket was closed
    ticket.closedAtRaw The date and time when the ticket was closed in raw format
    ticket.deadline The date and time when the deadline for this ticket is reached
    ticket.url The internal URL for the ticket. Used to get a direct link to the ticket
    ticket.dbiKey The dbi key/external id of the ticket if synchronized with DBI
    ticket.dbiAgentId The id of the agent used for synchronizing this ticket
    ticket.customer The id of the customer connected to this ticket
    ticket.customerUrl The external URL for the ticket. Used for a customer to get a direct link to the ticket. Requires the customer center.
    ticket.customerUrlEnc Same as above, except that all customer data in the URL is encrypted
    ticket.userUrl The internal URL for the ticket. Used to get a direct link to the ticket
    ticket.author The name of the author for the ticket
    ticket.status The name of the base status of the ticket
    ticket.ticketStatus The name of the extended status of the ticket
    ticket.slevel The name of the security level of the ticket
    ticket.ownerUsername The username of the owner of the ticket
    ticket.ownerFullName The full name of the owner of the ticket
    ticket.ownerCellphone The cell phone number of the owner of the ticket
    ticket.category Depending on the context, this can be either the id or the name of the category this ticket is connected to
    ticket.category.id The id of the category this ticket is connected to
    ticket.category.name The name of the category this ticket is connected to
    ticket.category.fullname Same as above, except that all parent categories are also listed. Categories separated with /
    ticket.priority The name of the priority for this ticket
    ticket.customerName The best name of the customer this ticket is connected to
    ticket. Any extra field on the ticket

    Config

    config.companyName The name of your company
    config.companyAddress The address of your company
    config.mailTag The tag used for identifying an Customer Service email
    config.smtpHost The SMTP host for Customer Service
    config.smtpPort The port used for SMTP access
    config.cgiBin The virtual directory for cgi‐bin access
    config.cgiUrl The host used to access Customer Service
    config.cgiUrlInternal The host used to access Customer Service user interface
    config.gfxUrl The URL to the gfx files
    config.warning The path to the warning files
    config.panicMail The email address which errors are sent to
    config.adminMail The email address which admin messages are sent to
    config.defaultMail The default "from" mail address
    config.uniqueId The unique id for this Customer Service installation
    config.tag Same as config.mailTag
    config.wwwPath The wwwPath as registered in the Registry table

    Message

    message.id The internal database id of the message
    message.slevelInteger The id of the security level for this message
    message.slevel The name of the security level for this message
    message.createdAt The date and time this message was created
    message.createdAt The date and time this message was created in raw format
    message.author The name of the author
    message.bodyHtml The HTML part of the message
    message.messageCategory What kind of message this is. 0= message, 1=bounce, 2= outboxfailed message
    message.body The HTML part of the message if exists, else plain text
    message.bodyPlain The plain text part of the message
    message.header The header of the message
    message.debugInfo If email filter debug is turned on, you can find the debug log here
    message.mailSorter The name of the email filter that was run on this message.
    message. Any extra field on the message

    User

    user.id The internal database id of the user
    user.loginname The login name of the user
    user.username The user name of the user
    user.firstname The first name of the user
    user.middlename The middle name of the user
    user.lastname The last name of the user
    user.email The email address of the user
    user.access The access of the user. This is actually a bit sequence represented as an integer, so hard to be useful
    user.status The status of the user. 1 = Normal, 2 = Not available, 3 = Deleted, 4 = Read Only
    user.language The GUI language of the user. 0 = Norwegian, 1 = English, 2 = German, 3 = Swedish, 4 = Danish, 5 = Dutch
    user.dictionary The default dictionary language of the user. Same codes as for user.language
    user.signature The signature for the user
    user.name The full name of the user
    user."" Any extra field on the user