Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

...

Info

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

View file
nameAdd a Subscriber to the Inbound Task Queue — Email-schema.json

1.1.1. Flow description

Component  

Block of component

 Component parameters

Description

Branch 1

Start

Image Added

Start component

Custom code

image-20240830-083731.pngImage Added

image-20240830-084010.pngImage Added

In the Custom code field, enter:

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

If

Image Addedimage-20240830-083846.pngImage Added

In the Expression field, enter the following condition:

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

Branch 2

Script

image-20240830-083641.pngImage Addedimage-20240830-090256.pngImage Added
  • 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:

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

Custom code

image-20240830-083740.pngImage Added

image-20240830-094036.pngImage Added

In the Custom code field, enter:

Code Block
    {
        "linkContact": {
            "contactIds": "${contactIds}"
        }
    }

Branch 3

Callback Queue

image-20240830-094010.pngImage Added

image-20240905-082537.pngImage Added
  • 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.