Contacts
Use this API to create, update and delete contacts.
If you are just looking to create forms that collect contacts in a secure manner, it is recommended that you use the forms:form control with the contactmode attribute.
Security Warning: With great power comes great responsibility. This API is for experienced developers to query data from the contacts component. Customer data is sensitive, so you must take great care not to introduce a data leak or vulnerability.
Security Warning: You can retreive contact data via functions such as get() and getAll(). This can be displayed on a public website through the use of a repeater or varDump().
Security Warning: This API also allows you to save customer data. Ensure that if updating existing records, any supplied contact_id is validated so only the intended contacts can be overwritten.
Methods
Invoke via \Components\Customers\Contacts::method()
Click a method name to copy it.
Returns the current contact logged in
Returns a HTML formatted address for the contact
Return
Contact's full address
Returns the id of the contact currently logged in
Returns the country of the current contact
This function will always return a country code as it will fall back to the user's
GeoIP location if not logged in.
Returns the email address of the contact currently logged in
Gets the user's full name
Return
Contact's first and last names as a concatenated string
Retreives an attribute for the current user
Return
Value of the attribute
Returns whether the user is fully registered or not
Return
true if the user has a password, else false
Returns whether or not the user is logged in.
Return
true if logged in, else false
Returns whether the user logged in this session or not
Return
true if logged in this session, else false
Logs out the current user
Sets an attribute for the current user
Suggests a unique username based on the users name
Gets a record from the database
Parameters
$iContactId
int
A record's contact_id
Return a set of records from the database
Returns all contact records for a given email address
Gets a single field from a record
Parameters
$iContactId
int
A record's contact_id
Returns the number of records in the database (matching the filter if specified)
Returns the contact id from an email address
Deletes a record from the database
Parameters
$iContactId
int
A record's contact_id
Return
Returns true if record existed and was deleted, otherwise false
Assumes the role of a user for segment
Resumes the role of the previous impersonation
Parameters
$bShowEmailMarketing
mixed
$bShowAdministrators
mixed
Saves a record into the database
Saves a specific column of a row into a database
Parameters
$iContactId
int
A record's contact_id
Return
Array of
Contacts that match the search query.