This section shows you how to create Text Filters.
These Text Filters are applied to Tickets and to Followups at creation and at update time.
They are based on PHP regular expressions (regexp). The regexp filters are case insensitive and unicode.
Ticket Cleaner Plugin internal mechanism is based on
preg_replace() PHP function (refer to PHP online help for more details)
Text Filter Types¶There are several different types of Text filters:
- Filter type = 0, for signatures start
- Filter type = 1, For signature end
- Filter type = 2, For Ticket and Followup description
- Filter type = 3, For Ticket title
It's possible to have several different filters for each type, then filters are ordered (with an order number) to define priority inside a type.
It's possible to define if a filter is active or not.
It's possible to set a name and description for each filter.
Let's see Filter Types now:
Text Filter Type 0 and 1¶Type 0 is used to define what should be the start of a signature (typically inside emails)
Type 1 is used to define what should be the end of a signature (typically inside emails)
Let's look at an example:
We are going to define two Filters of type 0 and with the following order (or priority):
- "Registration number"
- "No employee or agent of the company"
The order will be used to set the priority of the start of signature.And we are going to define only one filter of type 1:
- "Any other distribution, use or reproduction is unauthorized and prohibited."
Text Filter Type 2¶
This type is used to define what replacements should be made inside Tickets and Followups descriptions.
Example: you want to replace three (or more) empty lines by only two...
The order is used to define order of replacements
Example: first replace three (or more) empty lines by two empty lines, and then replace multiple whitespaces (more than two) by only one space.
Text Filter Type 3¶
This type is used to define what what replacements should be made inside Tickets titles
This type is like type 2 but applied only on Ticket Titles
These are my own filters as an example: