Skip to main content

Scenario for automatic notification of the manager

Let's look at a typical case that can be implemented using scenarios in the Altcraft Marketing platform.

Here is the task. Every time the user performs any target action, the manager must receive a letter with information about the client.

Let's consider the implementation of this functionality through an API call from a scenario. The lead database is supposed to be created and filled.

Step 1. Create a manager database

First of all, it's necessary to create a database. Let's call it "Managers". You need to set up the database and specify its field structure. Then you need to create a new profile.

You can learn more about profile bases right there.

Step 2. Create a resource and a subscription

Only when the manager database is created and the profiles are added to it, it is necessary to create a resource (let's call it "Manager alerts"). When you create a resource, specify the "Managers" database in its settings. After the resource has been created, you need to subscribe a manager profile to it. In the example, let's add a subscription manually:

You can learn more about resources in this article.

Step 3. Create a template

Now it's time to create the template of the message that will be sent to a manager. Let's call it "Alerts". We're going to use variables apicontent to personalize messages.

Client email: {apicontent.mail}

Client phone number: {apicontent.ph_number}

The example of the template for notification of a manager:

You can learn more about templates in this article.

Step 4. Create a trigger

We're going to use a trigger campaign as a tool of notifying a manager. When creating it, you need to select the resource "Manager alerts", the template "Alerts", the condition for triggering - "API trigger call" and the database "Managers".

You can learn more about trigger campaigns right there.

Step 5. Create a scenario

The key element that will launch a trigger call and then send a notification to a manager is the "HTTP(S) API Call" node. Select POST DATA as the request type, Content type - JSON or XML (in our example, it's JSON). The URL contains the address at which the trigger will be called (api/v1.1/triggers/start). The body of the API request is placed in the Data section, according to which the "Trigger - notification" will be called (you can learn more about the API right there).

{
"token": "bfc505684d774e52b188fa1f003cd5ed",
"id": 270,
"matching": "email",
"email": "manager@company.com",
"content": {
"mail": "{lead.email}",
"phones": "{lead.phones}"
}
}

This request specifies the API token for authorization, the trigger identifier, the email of the manager, as well as the email and phone number of the lead, about which the manager will be notified.

info

When sending a request, an API token is required for authorization. The token must be created in the platform. More details can be found in our article.

Well, you've just completed the configuration of the manager's notification automation scenario!