Contact

Extends Object. The Contact object represents data of Contacts such as page authors, current user information or order customer.

Privacy Notice
For security reasons Contact objects are made available either via the Controller, via other EVML objects (such as Page Authors), or if an Administrator has marked a Contact profile as "searchable". Websites should manage Contact data responsibly and should not breach privacy rules when publishing personally identifiable information publicly.

Programmatically finding Contacts

Before fetching Contact data, check whether the information is already available to you from existing Objects. If not, you can gain access to a Contact profile from any template programmatically.

If you need to find multiple Contacts you should use the ContactSearch object instead - it's more efficient.

The example below shows how you can find a Contact profile by its system ID.

<?ev
    var profile = new Contact();
    
    if (profile.findById(1234)) {
        print(profile.firstname + ' was found');
    } else {
        print('Contact was not found');
    }
?>

Properties
avatar Url
A URL to a square image representing the Contact.
If the Contact has a thumbnail image it will be cropped to a square, otherwise an image will be generated for the Contact.
For greater control over how Contacts are rendered you should use the thumbnail property.
biography String
A description about the contact. This can be used for short author biographies. It is not intended to contain full page contact profiles and should not contain HTML. We recommend using the website property with a relative or absolute path to the contact's full page profile.
company String
Company name.
created Date
The date the Contact profile was created.
department String | null
The Contact's department within "company".
division String | null
The division of the "company" Contact's position is associated with.
email String
Email address.
facebook String | null
The Contact's Facebook page.
firstname String
First name.
flickr String | null
The Contact's Flickr page.
googlePlus String
Deprecated. The Contact's Google Plus page.
id Number
The system ID for this contact.
hasNoType Boolean
Deprecated. Determines whether the Contact data has no representation. This is set for legacy reasons, but should not be encountered from Evance 5+.
hasPassword Boolean
Determines whether the Contact has set a password, this is used for the purposes of user invitations or alerts. You are unable to gain access to any password data.
instagram String | null
The Contact's Instagram channel.
isBranch Boolean
Determines whether the Contact data represents a Branch of the current Account. Generally this is encountered within Store Finders.
isGuest Boolean
Determines if the Contact data is from a non-registered user of the website. Guest data is rarely accessible, and generally only available when generating emails, or order tracking portals.
isHQ Boolean
Determines whether the Contact data represents the business details of the Account.
isRecipient Boolean
Determines whether the Contact data represents a Campaign List recipient. Recipient data is rarely accessible, and generally only available within email confirmation templates.
isUser Boolean
Determines if the Contact is a registered user of the website.
lastname String
Last name (also known as family name or surname).
leaveDate Date|null
Represents an employee's leaving date. This may only be set by an administrator. Therefore, a Contact's leaving date may be useful in team archives.
linkedIn String | null
The Contact's LinkedIn page.
mobile String
The Contact's mobile phone number.
phone String
Daytime/primary phone number for the contact.
pinterest String | null
The Contact's Pinterest page.
position String
Occupational position / job title of the contact.
reference String
A custom reference for the Contact set by an Administrator. This may be used as a customer reference number.
registeredNumber String
The Contact's Company Registration Number if applicable.
startDate Date|null
Represents an employee's starting date. This may only be set by an administrator. Therefore, a Contact's start date may be useful in team profiles.
taxNumber String
The Contact's VAT/Tax Registration Number if applicable.
thumbnail Url | null
The image/avatar of the contact.
twitter String | null
The Contact's Twitter feed.
type String
The Contact's type may be one of the following:
  • branch - the Contact information represents a branch of the Site's hq. This is applicable to companies with multiple offices.
  • guest - Guest profiles are non-user accounts and are only available via ContactSearch when made "searchable". This type of Contact may be useful when building Company or Team directories.
  • hq - Contact information representing the Site's primary business information.
  • user - User profiles are available for the current user, or via ContactSearch when made "searchable".
username String
The username within the system for the contact (not all users have one).
vimeo String | null
The Contact's Vimeo channel.
website String
The website address for the contact.
youTube String | null
The Contact's YouTube channel.


Methods
accessRoles() Object

Returns a list of the Contact's access roles. This may be used to determine whether a logged in user has access to certain functionality.

Please ensure this property is used securely. You should never disclose the list of access roles a user has publicly.

address() Address | null
Returns the primary Address of the Contact.
addresses() Address[]
Returns an array of zero or more addresses associated with the Contact profile.
billingAddress() Address | null
Returns the Contact's preferred billing address.
branches() Array
Returns a collection of Branch objects this contact is assigned to. This may be useful when displaying team pages.
findById(Number: id) Boolean
Find a Contact profile but its id. Returns true if the Contact reference supplied represents:
  • a valid Contact profile
  • an active Contact profile (has not been disabled)
  • a Contact profile marked as searchable
Returns false if any of these conditions are not met.
findByReference(String: ref) Boolean
Find a Contact profile but its unique reference. Returns true if the Contact reference supplied represents:
  • a valid Contact profile
  • an active Contact profile (has not been disabled)
  • a Contact profile marked as searchable
Returns false if any of these conditions are not met.
fullname() String
Combined first & last name of the contact.
hasAccessRole(reference) Boolean
Returns a true value if the Contact has an access role with the reference supplied.
lastLogin() Date | null
Returns the last date (prior to the current session) when the User logged in.
metafields() Object
Returns an Object containing zero or more metafields.
shippingAddress() Address | null
Returns the Contact's preferred shipping address.
tags() Object
Returns an Object containing all tags assigned to the Contact.
toString() String
Returns the full name of the Contact.
wishlist() ProductCollection
Returns a list of Products within a User's weishlist if they are logged in.