Jump to content

Action Hooks


hostwes

Recommended Posts

You don't call actionhooks at all directly.

 

One example is the actionhook_ClientDetailsEdit($vars)

 

When a client edits their details internally in whmcs the actionhook is called

$vars is an array of variables that can be used in that function

In this case the only variable sent is the clients id

From that you write your code to perform whatever action that you are trying to achieve when a client changes their details.

Link to comment
Share on other sites

then you would add your code to send an email to this actionhook function

function actionhook_ClientSignup($vars) {

# This function runs when a new client is added

# $vars["ClientID"]

# $vars["FirstName"]

# $vars["LastName"]

# $vars["CompanyName"]

# $vars["Email"]

# $vars["Address1"]

# $vars["Address2"]

# $vars["City"]

# $vars["State"]

# $vars["Postcode"]

# $vars["Country"]

# $vars["PhoneNumber"]

# $vars["Password"]

}

Open the file and look at the functions. They are all pretty well self explanatory.

includes/actionhooks.php

Link to comment
Share on other sites

But where would I add this code?

 

You add your code within the function

function actionhook_ClientSignup($vars) {

# This function runs when a new client is added

# $vars["ClientID"]

# $vars["FirstName"]

# $vars["LastName"]

# $vars["CompanyName"]

# $vars["Email"]

# $vars["Address1"]

# $vars["Address2"]

# $vars["City"]

# $vars["State"]

# $vars["Postcode"]

# $vars["Country"]

# $vars["PhoneNumber"]

# $vars["Password"]

 

YOU PUT YOUR CODE HERE

 

}

 

Note the curley bracket at the bottom - means that is the end of the function.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated