Skip to main content

Customer Fields

Customer fields are custom data fields that can be used in addition to mail2many standard fields. They allow storing arbitrary additional information.

Basics​

Customer fields are created on request for a customer and can be used across all accounts of that customer.

Properties:

  • Each field has a unique ID
  • Multilingual names and descriptions
  • Defined field type (where it is used)
  • Defined data type (what kind of data)

Field types​

Customer fields can be used in different areas of the system:

Field TypeValueDescriptionExample
Subscriber1Per subscriberFavorite country, VIP status, customer number
Account2Once per accountCompany name, Opening hours
Mailing3Per mailingCampaign ID from analytics tool

Data types​

Customer fields support different data types:

Data TypeValueExample
String1"Nepal", "VIP"
Integer242, 2024
Date3"2025-03-15"
Boolean4true, false
String List5["Nepal", "Thailand"], ["Deutschland"]
Currency6"100.24", "42.10"

Retrieve customer fields​

All customer fields of an account can be retrieved via API:

Endpoint: GET /customerFields

Response:

{
"data": [
{
"objectType": "CustomerField",
"id": 1,
"fieldType": 1,
"type": 1,
"isAvailableForImport": false,
"isAvailableForExport": false,
"isEditable": true,
"translations": {
"de": {"name": "Lieblingsland", "description": null},
"en": {"name": "Favourite country", "description": null}
},
"value": null,
"createdAt": "2024-09-10 14:14:07",
"updatedAt": "2024-09-10 14:14:07"
}
],
"meta": {"include": [], "meta": {}}
}

Important fields:

  • fieldType – Indicates whether this is a subscriber, account, or mailing field (see table above)
  • type – Data type (see table above)
  • translations – Multilingual names and descriptions

Save customer fields​

Subscriber fields​

Subscriber fields are passed in the customerFields object when creating or updating a subscriber:

Endpoints:

  • POST /subscribers
  • PUT /subscribers/{id}
  • POST /subscribers/upsert
  • POST /subscribers/register

Example:

Assume the following customer fields exist:

  1. Favorite country (string)
  2. Number of booked trips (integer)
  3. Last trip (date)
  4. VIP subscriber (boolean)
{
"email": "florian.reichart@atrivio.de",
"customerFields": {
"1": "Nepal",
"2": 2,
"3": "2018-06-01",
"4": true
}
}
tip

The keys in the customerFields object are customer field IDs. Values must match the defined data type.

Account fields​

Account fields are stored directly on the account. See the Endpoint Documentation for details.

Example:

{
"value": "My company name"
}

Usage in newsletters​

Customer fields can be used in HTML newsletters like variables, but with C instead of V:

Syntax:

{{C:<ID>:<DEFAULT>}}

Example (simple variable):

{{C:1:Europa}}

→ Outputs customer field with ID 1, if empty: "Europa"

Example (inside variable area):

[[A:-:1:-:Hallo {{V:1}} aus {{C:1}}:-:Hallo]]

→ Combines standard variable (V:1 = salutation) with customer field (C:1 = country)

info

More details on variable syntax can be found in Variables.