Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 395 Vote(s) - 3.45 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Triggering suspend, terminate hooks in WHMCS

#1
After reading through the [WHMCS documentation][1] 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('[email protected]', '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?


[1]:

[To see links please register here]

Reply

#2
I found that hooks like `AfterModuleSuspend` and `AfterModuleUnsuspend` aren't accessible until installing a _Provisioning Module_ into the WHMCS instance. Here's sample code for a module:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through