Versions Compared

Key

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

...

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 Modified

Start component

Custom code

image-20240830-083731.pngImage Modified

image-20240830-084010.pngImage Modified

In the Custom code field, enter:

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

If

Image Modifiedimage-20240830-083846.pngImage Modified

In the Expression field, enter the following condition:

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

Branch 2

Script

image-20240830-083641.pngImage Modifiedimage-20240830-090256.pngImage Modified
  • 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 Modified

image-20240830-094036.pngImage Modified

In the Custom code field, enter:

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

Branch 3

Callback Queue

image-20240830-094010.pngImage Modified

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