Create a process that allows to send messages only to unique phone numbers

Published April 27, 2023
Modules
Difficulty

This use case presents a solution to prevent sending the same message to the profiles who have the same phone number. Sharing the same phone number by profiles may happen for example, when a person leaves the company and a new employee takes over a work phone with the phone number of the previous employee; or when a person creates two accounts with different personal data but the same phone number.

The core idea of this use case is to check the database for the same phone number and ensure that only one message is sent out when multiple profiles have the same number. This solution is designed to save costs and ensure that profiles do not receive unnecessary messages.

The assumption of this use case is importing all customers with unique phone numbers and enabled marketing agreement in the SMS channel to a catalog. All these customers will have a phone_unique tag assigned to them. Then, every time a customer enables SMS marketing agreement a workflow will verify whether the phone number for this customer is unique. If so, it will be tagged with phon_unique.

Note: We recommend using the phone_unique tag for addressing recipients in mass campaigns to all customers (for example, general information about important changes that do not contain personalization). It is not necessary for real-time campaigns, especially those triggered by specific user behaviors and activities such as entering a page, purchasing, and so on, because there is a small probability of sending the same message several times to one number. However, this risk is high with large and mass shipments. It is important to be careful with the personalization of such messages, especially without additional verification of ness of the phone number.

Prerequisites


  • Create a catalog in Synerise in which you will store customers with unique phone numbers

This will allow you to select customers with a phone_unique tag as the recipients of your future SMS campaigns - this way you will make sure each customer won’t receive the same message several times.

  • In Data Management > Profile Tags, add the following tag: phone_unique It will be used later in the process.

  • Create a workspace API Key which you will use in the process.

Process


In this use case, you will go through the following steps:

  1. Create a segmentation to group customers who have a phone number assigned and enabled marketing agreement in the SMS channel.
  2. Create a workflow which sends the customers from the segmentation to the catalog.
  3. Download the file with customers from the catalog.
  4. Transform data in the file: add a column with a phone_unique tag, remove item_key column, and rename the id column.
  5. Create a workflow which imports the modified file with customers to Synerise.
  6. Create a workflow that verifies uniqueness of the phone number and assigns a tag to a customer.
  7. Create a workflow that deletes a tag when a customer withdraws consent for receiving SMS.

Create a segmentation


In this part of the process, you will create a segmentation of customers who have a phone number and enabled a marketing agreement in the SMS channel.

  1. Go to Analytics iconAnalytics > Segmentations V2 > New segmentation.
  2. Enter the name of the segmentation.
  3. From the Has property dropdown list, select the phone attribute.
  4. Click the Choose button, and from the list of operators, choose Boolean, and then select Is true.
  5. From the Has property dropdown list, select the SMS agreement attribute.
  6. Click the Choose button, and from the list of operators, choose Boolean, and then select Is true.
  7. Save the segmentation.
The view of the segmentation configuration
Segmentation configuration

Create a workflow which sends the customers from the segmentation to the catalog


In this part of the process, you will create a workflow that imports customer data (phone number) to a file and sends it to the catalog you created as a part of prerequisites. The data will be deduplicated, which means the catalog will contain only unique phone numbers.

  1. Go to Automation icon Automation > Workflows > New workflow.
  2. Enter the name of the workflow.

Define the Scheduled Run trigger node


At this stage, configure the conditions that trigger the workflow.

  1. As the trigger node, select Scheduled Run.
  2. In the configuration of the node:
    1. Change the Run trigger option to one time.
    2. Choose the Immediately option.
    3. Confirm by clicking Apply.
The configuration of the Scheduled Run node
The configuration of the Scheduled Run node

Select customers to export


In this part of the process, select a segmentation of customers you created in the previous part of the process. Then, you will select the attribute (phone) whose value will be exported to a catalog in further steps.

  1. Add the Get Profiles node.

  2. In the configuration of the node:

    1. Select the segmentation you created in the previous step to extract customers’ data.
    2. In the Attributes section, select phone.
    3. Confirm by clicking Apply.
    The configuration of the Get Profiles node
    The configuration of the Get Profiles node

Add the Import to catalog node


In this part of the process, select a catalog to which the customer data will be imported.

  1. Add the Import to catalog node.
  2. In the configuration of the node:
    1. Select the catalog created as a part of the prerequisites to which the data will be imported.
    2. In the Primary key field, enter the phone attribute.
    3. Confirm by clicking Apply.
The configuration of the Import to catalog node
The configuration of the Import to catalog node

Prepare the final settings


  1. Add the End node and connect it to the Import to catalog node.
  2. Optionally, add titles to each node so the workflow will be more understandable to your colleagues.
    Screenshot presenting workflow
    Prepare workflow
  3. Activate the workflow by clicking Save & Run.
    Result: The data will be sent to a catalog and de-duplicated during import.

Export the file from the catalog


In this part of the process, you will download the file you imported to the catalog.

  1. Go to Data Management > Catalogs.
  2. Choose the catalog from the list.
  3. To download the file with your data, click Download CSV .

In the next step, you will use the exported file to create a data transformation rule which you will use further in the process in the Data Transformation node.

Transform data


In this part of the process, you will perform the following modifications to the file:

  • remove the item_key column
  • rename the id column to clientId
  • add the tags column with the phone_unique value
  1. Go to Automation icon Automation > Data Transformation > Create transformation.
  2. Enter the name of the transformation.
  3. Click Add input.

Add file with sample data


The Data input node allows you to add a file to be modified. In further steps, you define how the data in the file will be modified (transformation rules). Later, when this transformation is used in the workflow in the Data Transformation node, the system uses the rules to transform a file selected in the workflow.

  1. On the pop-up, click Add example.
  2. Upload the file exported in the previous step.
  3. Click Apply.

Remove column


Use the Remove columns node, which allows you to remove the item_key column.

  1. On the Data Input node, click the grey dot.
  2. From the dropdown list, select Remove columns.
  3. In the configuration of the node:
    1. Leave the Remove Columns option selected in the dropdown menu.
    2. Leave the default value in the dropdown (Equal).
    3. In the text field, enter item_key.
      The configuration of the Remove columns node
      The configuration of the Remove columns node
    4. Confirm by clicking Apply.

Rename column


In this part of the process, change the name of the id column to clientId.

  1. On the Filter column node, click the grey dot.
  2. From the dropdown list, select Rename column.
  3. Click the Rename column node.
  4. In the configuration of the node:
    1. Click Add rule.
    2. Click Add column.
    3. Select the id column.
    4. Under Edit values by, from the dropdown list, select Replacing.
    5. In the text field, enter clientId.
      The configuration of the Rename column node
      The configuration of the Rename column node
    6. Confirm by clicking Apply.

Add the new column


In this part of the process, you will add the new tags column with the phone_unique value.

  1. On the Rename Column node, click the grey dot.
  2. From the dropdown list, select Add column.
  3. Click the Add column node.
  4. In the configuration of the node:
    1. In the Add column field, enter the name of the column. In this use case, it’s tags.
    2. From the dropdown list, select Static value.
    3. In the value box, enter phone_unique.
    4. Leave Handle incomplete data at default (Skip row if error occurred) to skip missing or invalid data which may occur during transformation.
    5. Confirm by clicking Apply.
The configuration of the Add new column node
The configuration of the Add new column node

Add the finishing node


This node lets you preview the output of the transformation rules applied to the file.

  1. On the Add column node, click the grey dot.

  2. From the dropdown list, select Data Output.

  3. To preview the results, click the Data Output node.

    The preview of modifications to the file
    The preview of modifications to the file
  4. Close the preview

  5. In the upper right corner, click Save and publish.

    The diagram of data transformation
    The diagram of data transformation

Create a workflow which imports the modified file with customers to Synerise


In this part of the process, you will create a workflow that applies transformation rules you created in the previous part of the process to the file with customers data and import the modified file to Synerise. As a result, the profiles will be updated.

  1. Go to Automation icon Automation > Workflows > New workflow.
  2. Enter the name of the workflow.

Define the Scheduled Run trigger node


At this stage, you will define the conditions that launch the workflow.

  1. As the trigger node, add Scheduled Run.
  2. In the configuration of the node:
    1. Change the Run trigger option to one time.
    2. Choose the Immediately option.
    3. Confirm by clicking Apply.
The configuration of the Scheduled Run node
The configuration of the Scheduled Run node

Select file to import


Select the file you exported in part of the process.

  1. Add the Local file node.
  2. In the configuration of the node:
    1. Upload the file.
    2. Confirm by clicking Apply.
Local file transfer
Local file transfer

Add Data Transformation node


Select a data transformation rule you created in this part of the process.

  1. Add the Data Transformation node.

  2. In the configuration of the node, select the data transformation you have created before.

    The configuration of the Data Transformation node
    The configuration of the Data Transformation node
  3. Confirm by clicking Apply.

Add import profiles and finishing node


In this part of the process, you will import the transformed file with customers to Synerise.

  1. Add the Import profiles node.
  2. Add the End node.
  3. In the upper right corner, click Save & Run.
The view of the workflow configuration
The workflow configuration

Create a workflow that verifies uniqueness of the phone number and assigns a tag to a customer


In this part of the process, you will create a workflow that is launched when a customer enables marketing agreement in the SMS channel. The workflow checks whether the phone number is unique, if so the customer is assigned with a phone_unique tag and the catalog which stores unique phone numbers is updated.

  1. Go to Automation icon Automation > Workflows > New workflow.
  2. Enter the name of the workflow.

Define the trigger node


The workflow is triggered by Profile Event where the triggering event is profile.updated with the profile.receivesmses parameter which is set to true.

  1. Add the first node - Profile Event. In the node configuration:
    1. From the Choose event dropdown list, choose the profile.updated event.
    2. Click where icon button.
    3. From the Choose parameter dropdown list, select profile.receivesmses.
    4. From the Choose operator dropdown list, select Is true(Boolean).
  2. Click Apply.
The view of the Profile Event node configuration
Configuration of the Profile Event node

Add the Profile filter node


In the next stage, using the Profile filter, you check if the customer already has the phone_unique tag and phone number. You take into account customers who have phone but do not have the phone_unique tag.

  1. Add the Profile Filter node.

  2. In the settings of the node, choose Profiles > Attributes and select the phone_unique tag.

  3. As Operator, choose Boolean - Is true and nd modify the “Profile matching attribute” to “not matching attribute.”

  4. Click Choose filter and select the attribute phone.

  5. As the Operator, choose Boolean - Is true.

  6. Click Apply.

  7. For the Not Matched path, add the End node .

  8. Click Apply.

    The Profile Filter node configuration
    The Profile Filter node configuration

Configure the Outgoing Integration node


In this part of the process, you will send a request to retrieve all items from the catalog to check if the phone number exists in the catalog.

  1. To the Matched path, add the Outgoing integration node. In the configuration of the node:
    1. Choose Custom webhook.
    2. In the Webhook name field, enter getPhoneFromCatalog.
    3. In the URL section:
      1. Choose the GET method.
      2. Enter the following endpoint: https://api.synerise.com/catalogs/bags/XXXX/items?itemKey={{client.phone}}, replace XXXX with the ID of your catalog.
    4. As the method of authorization, select by API key.
    5. From the dropdown list, select the API key you created as a part of prerequisites.
  2. Click Apply.
Webhook settings
Webhook settings

Configure the Event Filter node

The workflow will wait for the webhook to return the value of the body.metaData.totalCount parameter. If it’s other than 0, the workflow will end. If it is 0, the profile will be updated with the phone_unique tag.

  1. As the next node, add Event Filter. In the configuration of the node:
    1. In the Check field, from the dropdown menu choose for period of time.
    2. Set the time range. In our case, it is 5 minutes.
    3. In the Define conditions field, from the Choose event dropdown menu, choose webhook.response event.
    4. Click the + where button and select name.
    5. As the logical operator, select Equal (String).
    6. As the value, add the name of the event used in the previous node: getPhoneFromCatalog.
    7. Click the + where button and select body.metaData.totalCount.
    8. As the logical operator, select Equal (Number).
    9. As the value, add 0.
  2. Click Apply.
  3. For the Not matched path, add the End node .
Event filter node settings
Event filter node settings

Add the Update Profile node


  1. For the Matched path, add the Update Profile node.
  2. From the dropdown list, select phone_unique tag.
  3. Leave the right dropdown list at default (Add).
  4. To save the changes, click Apply.
Screenshot presenting update profile node
The configuration of the Update profile node

Configure the Outgoing Integration node


In this step, your catalog with unique phone numbers will be updated.

  1. Add Outgoing integration node. In the configuration of the node:
    1. Choose Custom webhook.
    2. In the Webhook name, enter addPhoneToCatalog.
    3. In the URL section:
      1. Choose the POST method.
      2. Enter the following URL: https://api.synerise.com/catalogs/bags/XXXX/items?itemKey={{client.phone}}, where XXXX is the ID of your catalog.
    4. In the Body section, enter:
          {
          "itemKey": "{{client.phone}}",
          "value": {
          "id": "{{client.id }}",
          "phone": "{{client.phone}}"
          }
          }
          
  2. As the authorization method, select by API key.
Webhook settings
Webhook settings

Add the finishing node


  1. Add the End node.
  2. In the upper right corner, click Save & Run.
    Result:
    The workflow configuration
    The workflow configuration

The next step is to create a workflow that will be triggered when a customer withdraws their consent. The workflow has similar structure to the previous one. What changes here is the trigger, instead of Profile Event, you will use the Audience node that is repeatedly triggered, for example everyday, at a certain time.

  1. Go to Automation icon Automation > Workflows > New workflow.
  2. Enter the name of the workflow.

Define the trigger node


The workflow is triggered for specific group of customers every date at a define time.

  1. Start the workflow with the Audience node.

  2. In the configuration of the node, set the Run trigger option to repeatable.

  3. Set the interval to 1 per day.

  4. Choose the day and time when the process starts.

  5. Select the time zone.

  6. In Define audience, choose New Audience and click Define conditions. Our audience will be a group of users who has phone_unique tag and change their sms agreement.

    1. As the first condition, from the Choose filter dropdown menu, choose phone_unique attribute.
    2. Choose operator as Is true (Boolean).
    3. As the second condition, from the Choose filter dropdown menu, choose the SMS agreement attribute.
    4. Choose operator as Equal (String) and add the value. In our case it will be false.
    Configuration of the Segment in the Audience node
    Configuration of the segmentation in the Audience node
  7. Click Apply.

Configuration of the Audience node
Configuration of the Audience node

Add the Profile filter node


In the next stage, using the Profile filter node, you check if the customer has the phone_unique tag and phone number.

  1. Add Profile Filter node.

  2. In the settings of the node choose Profiles > Attributes and select the tag phone_unique.

  3. As the Operator, choose Boolean - Is true.

  4. Click Choose filter and select the attribute phone.

  5. As the Operator, choose Boolean - Is true.

  6. Click Apply.

  7. For the Not Matched path, add the End node .

    The Profile Filter node configuration
    The Profile Filter node configuration

Configure the Outgoing Integration node


In this part of the process, you will send a request to retrieve all items from the catalog to check if the phone number exists in the catalog.

  1. To the Matched path, add the Outgoing integration node. In the configuration of the node:
    1. Choose Custom webhook.
    2. In the Webhook name field, enter getPhoneFromCatalog.
    3. In the URL section:
      1. Choose the GET method.
      2. Enter the following endpoint: https://api.synerise.com/catalogs/bags/XXXX/items?itemKey={{client.phone}}, replace XXXX with the ID of your catalog.
    4. As the method of authorization, select by API key.
    5. From the dropdown list, select the API key you created as a part of prerequisites.
  2. Click Apply.
Webhook settings
Webhook settings

Configure the Event Filter node


The workflow will wait for the webhook to return the value of the body.metaData.totalCount parameter. If it’s equal 0, the workflow will end, because it means that the number is not in the catalog and no need to remove the tag since the number was not unique and the workflow ends. If it’s 1, it means the number exists in the catalog because it was unique and the workflow must go on.

  1. As the next node, add Event Filter. In the configuration of the node:
    1. In the Check field, from the dropdown menu choose for period of time.
    2. Set the time range. In our case, it is 5 minutes.
    3. In the Define conditions field, from the Choose event dropdown menu, choose webhook.response event.
    4. Click the + where button and select name.
    5. As the logical operator, select Equal (String).
    6. As the value, add the name of the event used in the previous node: getPhoneFromCatalog.
    7. Click the + where button and select body.metaData.totalCount.
    8. As the logical operator, select Equal (Number).
    9. As the value, add 1.
  2. Click Apply.
  3. For the Not matched path, add the End node .
Event filter node settings
Event filter node settings

Add the Update Profile node


  1. For the Matched path, add the Update Profile node.
  2. From the dropdown list, select phone_unique tag.
  3. Click the right dropdown list and select Remove.
  4. To save the changes, click Apply.
Screenshot presenting update profile node
The configuration of the Update profile node

Configure the Outgoing Integration node


In this step, you will remove a customer with their phone number from the catalog.

  1. Add the Outgoing integration node. In the configuration of the node:
    1. Choose Custom webhook.
    2. In the Webhook name field, enter removePhoneFromCatalog
    3. In the URL section:
      1. Choose the DELETE method.
      2. Enter the following URL:https://api.synerise.com/catalogs/bags/XXXX/items/{{event.params['body.data[0].id']}}, where XXXX is the ID of your catalog.
    4. As the authorization method, select by API key.
    5. From the dropdown list, select the API key you created as a part of prerequisites.
  2. Click Apply.
Webhook settings
Webhook settings

Add the finishing node


  1. Add the End node.
  2. In the upper right corner, click Save & Run.
    Result:
    The workflow configuration
    The workflow configuration

Check the use case set up on the Synerise Demo workspace


You can check the:

If you don’t have access to the Synerise Demo workspace, please leave your contact details in this form, and our representative will contact you shortly.

Read more


😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker