Skip to content

User

The following hooks are provided for User related events.

PreUserAdd

Executes just prior to a user being added to WHMCS. Changes to hook variables will not be honored.

Parameters

VariableTypeNotes
user_idintThe id of the user that has been added
firstnamestring
lastnamestring
emailstring
passwordstring
languagestring

Response

No response supported

Example Code

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

UserAdd

Executes as a user is being added to WHMCS.

Parameters

VariableTypeNotes
user_idintThe id of the user that has been added
firstnamestring
lastnamestring
emailstring
passwordstring
languagestring

Response

No response supported

Example Code

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

UserChangePassword

Executed when a change of password occurs for a user.

Parameters

VariableTypeNotes
useridintThe ID of the User being updated
passwordstringThe new password

Response

No response supported

Example Code

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

UserEdit

Executes when a user is edited.

Parameters

VariableTypeNotes
user_idint
firstnamestring
lastnamestring
emailstring
olddataarrayAn array of the previous user information

Response

No response supported

Example Code

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

UserEmailVerificationComplete

Executes upon successful completion of email verification by a user.

Parameters

VariableTypeNotes
userIdint

Response

No response supported

Example Code

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