Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

1. Description

This Flow schema is used for receiving email messages from the address specified in the Email profile settings. The Flow schema routes the received emails to the Queue for an Agent.

1.1. Flow example

An example flow can be seen in Figure 1.

Добавление абонента во входящую очередь задач - Email.png

For convenience, you can download the completed JSON file, which is attached below, and then import it.

1.1.1. Flow description

Component  

Block of component

 Component parameters

Description

Branch 1

Start

Start component

Custom code

image-20240830-083731.png

image-20240830-084010.png

In the Custom code field, enter:

    {
        "findContact": {
            "q": "${from}",
            "qin": [
                "emails"
            ],
            "setVar": "listContacts",
            "size": 10,
            "token": "SUPER"
        }
    }

If

image-20240830-083846.png

In the Expression field, enter the following condition:

+${listContacts.data.0.id} > 0

Branch 2

Script

image-20240830-083641.pngimage-20240830-090256.png
  • in the Set result to variable field, enter the name of the variable to which the code value is passed. For example, contactIds.

  • in the Script field:

      var a = JSON.parse(${listContacts}); 
      return JSON.stringify(a.data.map(function(i){ return i.id}))

Custom code

image-20240830-083740.png

image-20240830-094036.png

In the Custom code field, enter:

    {
        "linkContact": {
            "contactIds": "${contactIds}"
        }
    }

Branch 3

Callback Queue

image-20240830-094010.png

image-20240905-082537.png
  • in the Name field, enter the name by which inbound tasks will be labeled. You can specify it as a text or a variable. In this example, the variable ${subject} is used, representing the message's subject;

  • In the Queue field, select the Inbound Task Queue to which the email messages will be routed;

  • In the Destination field, specify the email address from which the message was received, using the variable ${from};

  • in the Set variables field, the variable message_id is defined as ${message_id} for further use, for example, in the Flow schema for email processing.

  • No labels