Advanced trigger features (regexp)

Support often receives messages from clients not only directly but also from colleagues, partners, and the no-reply address. In such cases, it is essential to find the client's address in the letter and respond directly to it, not to no-reply. If there are many such transfers, the search and copying of e-mail take extra time.

In the rules there is a parameter «text contains regexp», which simplifies such situations. You can set up a rule: an email, a phone number or a name are searched for in the subject or in the message itself. Then the system creates a new client profile and binds it to the request or, if the client with such data already exists in Usedesk, binds it to the request along with the history of appeals. And you can reply as usually.

A trigger will not update data in a current client card in a ticket- it will replace a client with another one anyway. If a trigger finds a client with the same data (e-mail, phone number or name) based on data received from a text, it will join a ticket to that client. If a trigger finds nothing, it will create a new client with just that data (for example, or just a phone number).

How to create this trigger

Let's take our example — we need instead of no-reply.

1. Choose the conditions for letters where the e-mail should change. Do not forget to choose the conditions by status = new, so that the e-mail changes as soon as the letter arrived in Usedesk.

2. Add a condition that will search for data in the message or the subject. The trigger must understand what to look for — phone, e-mail, or name. Also, precisely in the letter to look for it (in our case — after the word «e-mail»). To do this, you need to specify the data that we want to find in a particular format -— a regexp. In our example, a regular expression will look like this:

A regexp selects data in the text that fits its parameters because, for example, phone numbers will differ from time to time. Any programmer will write a regexp, but if you don't have it at hand, tell us exactly what the trigger should find, and we'll write the regexp ourselves and add it to the trigger.
Here are a couple of examples of the most useful and popular regexp:

E-mail: /([a-zA-Z0-9_-]+\.)*[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)*\.[a-zA-Z]{2,6}/
Phone number: /\+?([0-9]{2})-?([0-9]{3})-?([0-9]{6,7})/ /
(includes all 10-digit numbers with the country code from 1 to 9, with and without + sign).

3. It remains to update the client and select the data on which the client will search in Usedesk and update. In our example, it is an e-mail. Note that each trigger can only update one parameter in the client card:

The trigger is ready!