Using the {{customer}} or {{$customer}} function, it's possible to display all customer data for the user in your content. The easiest way to add these fields is in the content editor;
This generates the following source code:
Arguments
The following arguments can be used with this function:
Argument | Description |
---|---|
field | The customer field that needs to be displayed. |
default | A default value that can be specified for the field. This value will be displayed if the field is empty. |
assign | The ability to store the content in a variable. |
If the {{$customer}} function is used, the standard system fields can be called directly and no additional arguments are needed. Here is an overview of all available fields:
{{$customer.address}}
{{$customer.address2}}
{{$customer.address3}}
{{$customer.addressnumber}}
{{$customer.addressnumbersuffix}}
{{$customer.alt_address}}
{{$customer.alt_address2}}
{{$customer.alt_address3}}
{{$customer.alt_addressnumber}}
{{$customer.alt_addressnumbersuffix}}
{{$customer.alt_city}}
{{$customer.alt_country}}
{{$customer.alt_emailaddress}}
{{$customer.alt_state}}
{{$customer.alt_zipcode}}
{{$customer.birthday}}
{{$customer.birthplace}}
{{$customer.bouncecount_hard}}
{{$customer.bouncecount_soft}}
{{$customer.city}}
{{$customer.companyname}}
{{$customer.complaintcount}}
{{$customer.contactman}}
{{$customer.country}}
{{$customer.createdat}}
{{$customer.createdby}}
{{$customer.department}}
{{$customer.email_address}}
{{$customer.external_id}}
{{$customer.faxnumber}}
{{$customer.firstname}}
{{$customer.gender}}
{{$customer.homephone}}
{{$customer.id}}
{{$customer.imageurl}}
{{$customer.initials}}
{{$customer.jobtitle}}
{{$customer.lastname}}
{{$customer.maritalstatus}}
{{$customer.middlename}}
{{$customer.mobilephone}}
{{$customer.modifiedat}}
{{$customer.modifiedby}}
{{$customer.optin}}
{{$customer.pobox}}
{{$customer.prefix}}
{{$customer.state}}
{{$customer.smsoptin}}
{{$customer.suffix}}
{{$customer.title}}
{{$customer.track}}
{{$customer.website}}
{{$customer.workextension}}
{{$customer.workmobile}}
{{$customer.workphone}}
{{$customer.zipcode}}
Examples
Datamodel data
With {{$customer}}, you also have access to all data model records that are linked to a customer. By using the associated table name, all records of the customer are made available in an object. In the example below, we have a table named MyTable linked to the customers table:
In this example, there are 2 records available for a customer:
With the help of a filter, it is possible to filter the results, and with a foreach, you can loop through all the available data.: