1The hooks system allows you to extend WHMCS functionality by placing files in the /includes/hooks directory.
2WHMCS has a variety of hook points that run when specific events occur (for example, generating an invoice).
3To use this system, write your own code and register it with a hook point. WHMCS will execute that code when the hook runs.
4For a list of available hook points, see https://developers.whmcs.com/hooks/hook-index/.
5
6To use the example hook code below, copy the code, beginning with '<?php', and paste it into a file in the /includes/hooks directory.
7The filename must use the '.php' extension (for example, create_forum_account.php).
8Filenames beginning with an underscore '_' will not be loaded.
9
10<?php
11
12if (!defined('WHMCS'))
13 die('You cannot access this file directly.');
14
15function create_forum_account($vars) {
16
17 $firstname = $vars['firstname'];
18 $lastname = $vars['lastname'];
19 $email = $vars['email'];
20
21 // Add the code to create a remote forum account here.
22
23}
24
25add_hook('ClientAdd', 1, 'create_forum_account');
26