After reading through the WHMCS documentation on hooks, I am still a little confused about where to begin to trigger custom code when a Product is suspended or terminated.
Here is an example of the code I have in a file in includes/hooks
:
function hook_MyHookTest($vars) {
mail('my@email.com', 'WHMCS Test', "This hook test was successful!\n\n" . date('r'));
}
add_hook('AfterModuleSuspend', 1, 'hook_MyHookTest');
In the Products/Services
tab of the Client Profile, when I change the Status
of the product from "Active" to "Suspended", nothing happens. I've used the function hook_MyHookTest
with other hooks successfully, so I'm probably not understanding how AfterModuleSuspend
is used.
Does another "Module" need to be created from scratch in order to use this hook?