Contact

The following hooks are provided for Contact related events.

ContactAdd

Executes as a contact is being added to WHASOLS.

Parameters

Variable Type Notes
user_id int The user id the client belongs to
first_name string
last_name string
company_name string
email string
address1 string
address2 string
city string
state string
postcode string
country string
phonenumber string
tax_id string
tax_exempt string YES / NO
entry_date datetime
notes string
email_verified string YES/NO as Whether the client has verified their email address.
affiliate_emails bool Receives affiliate communications.
domain_emails bool Whether the client receives registration or transfer confirmations and renewal notices.
general_emails bool Whether the client receives account-related email.
invoice_emails bool Whether the client receives new invoices, reminders, and overdue notices.
product_emails bool Receives Welcome Emails, Suspension & Other Lifecycle Notifications.
support_emails bool Receives CC of all support ticket communications.

Response

No response supported

Example Code

<?php
add_hook('ContactAdd', 1, function($vars) {
    // Perform hook code here...
});

ContactDelete

Executes as a contact is deleted.

Parameters

Variable Type Notes
user_id int
contactid int

Response

No response supported

Example Code

<?php
add_hook('ContactDelete', 1, function($vars) {
    // Perform hook code here...
});

ClientDetailsValidation

Executes before adding a client or updating a client through the Admin or Client area.

Parameters

Variable Type Notes
user_id int The client’s id
id int The contact id
first_name string The client’s firstname
last_name string The client’s lastname
company_name string The client’s company, if entered
email string The client’s email
address1 string The client’s address1
address2 string The client’s address2, if entered
city string The client’s city
state string The client’s state
postcode string The client’s postcode/zipcode
country string The client’s country (2 character code)
phonenumber string The client’s phone number
tax_id string The client’s tax ID
payment_method_id int If selected, the client’s default payment method
currency int If selected, the client’s default currency
email_verified string YES/NO as Whether the client has verified their email address.
affiliate_emails bool Receives affiliate communications.
domain_emails bool Whether the client receives registration or transfer confirmations and renewal notices.
general_emails bool Whether the client receives account-related email.
invoice_emails bool Whether the client receives new invoices, reminders, and overdue notices.
product_emails bool Receives Welcome Emails, Suspension & Other Lifecycle Notifications.
support_emails bool Receives CC of all support ticket communications.

Response

Return accepts an array. Use Status and message as an array of strings for error messages.

Example Code

<?php
add_hook('ClientDetailsValidation', 1, function($vars) {
    return ["status"=>"error","message"=>"Error message feedback error"];
or
    return ["status"=>"success"];
});

ContactEdit

Executes when a contact is edited through the Client Area, Admin Area, or API.

Parameters

Variable Type Notes
user_id int The client’s id
id int The contact id
first_name string The client’s firstname
last_name string The client’s lastname
company_name string The client’s company, if entered
email string The client’s email
address1 string The client’s address1
address2 string The client’s address2, if entered
city string The client’s city
state string The client’s state
postcode string The client’s postcode/zipcode
country string The client’s country (2 character code)
phonenumber string The client’s phone number
tax_id string The client’s tax ID
payment_method_id int If selected, the client’s default payment method
currency int If selected, the client’s default currency
email_verified string YES/NO as Whether the client has verified their email address.
affiliate_emails bool Receives affiliate communications.
domain_emails bool Whether the client receives registration or transfer confirmations and renewal notices.
general_emails bool Whether the client receives account-related email.
invoice_emails bool Whether the client receives new invoices, reminders, and overdue notices.
product_emails bool Receives Welcome Emails, Suspension & Other Lifecycle Notifications.
support_emails bool Receives CC of all support ticket communications.

Response

No response supported

Example Code

<?php
add_hook('ContactEdit', 1, function($vars) {
    // Perform hook code here...
});