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 Type | Value | Description | Example |
|---|---|---|---|
| Subscriber | 1 | Per subscriber | Favorite country, VIP status, customer number |
| Account | 2 | Once per account | Company name, Opening hours |
| Mailing | 3 | Per mailing | Campaign ID from analytics tool |
Data types
Customer fields support different data types:
| Data Type | Value | Example |
|---|---|---|
| String | 1 | "Nepal", "VIP" |
| Integer | 2 | 42, 2024 |
| Date | 3 | "2025-03-15" |
| Boolean | 4 | true, false |
| String List | 5 | ["Nepal", "Thailand"], ["Deutschland"] |
| Currency | 6 | "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 /subscribersPUT /subscribers/{id}POST /subscribers/upsertPOST /subscribers/register
Example:
Assume the following customer fields exist:
- Favorite country (string)
- Number of booked trips (integer)
- Last trip (date)
- VIP subscriber (boolean)
{
"email": "florian.reichart@atrivio.de",
"customerFields": {
"1": "Nepal",
"2": 2,
"3": "2018-06-01",
"4": true
}
}
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)
More details on variable syntax can be found in Variables.