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.

We in Usedesk made the parameter "text contains regexp" in the triggers, which simplifies such situations. Now you can configure the trigger: in the subject or in the message itself, you search for an e-mail, a phone, or a name, and it is inserted into the client card automatically. And it is possible to answer as usual. In this case, if the client is already in the system and has written before from his e-mail, the letter from his personal cabinet will be pulled into the history of appeals.

How to create such a trigger

Let's take our example. We need support@usedesk.ru 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:
Email: /([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!

Was the article helpful?

Yes No