Sorry, not much help from WHMCS- Looking for info on actionhooks

Discussion in 'PHP' started by bigpapa, Nov 4, 2008.

  1. #1
    Here's a copy of the actionhooks.php file from my copy of WHMCS:

    <?php
    /*
    ********************** Action Hooks **********************
    * Action hooks allow you to write your own PHP code that *
    * will run when specific actions occur in WHMCS. There   *
    * is a function for each action that supports hooks. The *
    * variables avaible in a specific function are listed in *
    * the comments for that function. Invalid code here will *
    * will cause WHMCS to fail so ensure your code is valid. *
    **********************************************************
    */
    
    define("ACTIONHOOKSINC",true);
    
    function actionhook_ClientSignup($vars) {
    	# This function runs when a new user signs up through the shopping cart or registration page
    	# $vars["ID"]
    	# $vars["FirstName"]
    	# $vars["LastName"]
    	# $vars["CompanyName"]
    	# $vars["Email"]
    	# $vars["Address1"]
    	# $vars["Address2"]
    	# $vars["City"]
    	# $vars["State"]
    	# $vars["Postcode"]
    	# $vars["Country"]
    	# $vars["PhoneNumber"]
    	# $vars["Password"]
    }
    
    function actionhook_ShoppingCartCheckout($vars) {
    	# This function runs when the user checks out using the shopping cart
    	# $vars["OrderID"] - Order ID Number
    	# $vars["OrderNumber"] - 10 Digit Order Number
    	# $vars["InvoiceID"] - Invoice ID Number
    	# $vars["Products"] - Array of Product IDs from Order
    	# $vars["Addons"] - Array of Addon IDs from Order
    	# $vars["Domains"] - Array of Domain IDs from Order
    }
    
    function actionhook_InvoicePaid($vars) {
    	# This function runs when an invoice is fully paid and therefore the services renewed
    	# $vars["InvoiceID"]
    }
    
    ?>
    Code (markup):
    What do you do with it? How do you customize it? I'm looking to automatically make each new registered user's status as "Approved" instead of the default "Pending"

    I was told I can do this by using the actionhooks, but there is really no documentation on how to use this.

    Any assistance??
     
    bigpapa, Nov 4, 2008 IP