This solution is only available for the HTTP Request object

This Smarty solution is only available in the HTTP Request object with the purpose of sending a selection of customers to an external system. It allows bundling up to a maximum of 10,000 customers per request. However, it is advisable to start with smaller numbers initially to ensure smooth processing.

In the HTTP request object, it is possible to send data to an external system. This can be done as a request per customer or a selection of customers per request. For the latter example, the Smarty solution is required.

Below is an example flow in which $customerSelection can be used:


The $customerSelection can be accessed using a foreach statement. Please see the example below:

Foreach example with $customerSelection

{{strip}}
[
{{foreach from=$customerSelection item=customerItem name=customerLoop}}
   {
        "id": "{{$customerItem.id}}",
        "email": "{{$customerItem.emailaddress}}",
        "firstname": "{{$customerItem.firstname}}",
        "address": "{{$customerItem.address}}",

        "hash": "{{$customerItem.customerOption.E11}}",

        "campaignOption": "{{$customerItem.campaignOption.F11}}"
  }
  {{if !$smarty.foreach.customerLoop.last}},{{/if}}

{{/foreach}}
]
{{/strip}}


Output:

[
  {
    "id": "1",
    "email": "customer1@domain.com",
    "firstname": "Anton",
    "address": "Amersfoortseweg",
    "hash": "6d5b53d0-140a-11ee-be56-0242ac120002",
    "campaignOption": "Website"
  },
  {
    "id": "2",
    "email": "customer2@domain.com",
    "firstname": "William",
    "address": "Kalkoenstraat",
    "hash": "869420fc-140a-11ee-be56-0242ac120002",
    "campaignOption": "Store"
  },
  {
    "id": "3",
    "email": "customer3@domain.com",
    "firstname": "Carl",
    "address": "Krommestraat",
    "hash": "8d3d95d2-140a-11ee-be56-0242ac120002",
    "campaignOption": "Website"
  }
]


Tip: System fieldnames

To determine the field name for specific system fields, you can easily insert the variable in an email or page within the Deployteq interface. Follow these steps:

Select "Insert" in your email or page editor.

By following these steps, you will insert the corresponding variable or field name into your email or page, allowing you to retrieve and display specific system field values dynamically.

Choose the desired system field, for example, a customer field;


Select the field name and confirm the dialog:


Copy the field name in the "field" element in the Smarty variabel: