Jump to content
EpoxyElegant

What triggers AfterModuleCreate?

Recommended Posts

Hello, I'm trying to use the AfterModuleCreate hook but I don't understand how or what triggers this hook. The documentation says, "Executes upon successful completion of the module function." I thought that was helpful enough but it's not.

What module function? What determines it's success? When does this happen? Is it after adding an order? Can this be triggered when adding an order from the admin dashboard immediately without changing any of the status?

 

Thank you.

Share this post


Link to post
Share on other sites

I can't edit my post, so I'll write this here.

What I'm trying to do is run a script that will trigger right after an Administrator creates a new order. The hook will grab the order and executes some codes to do stuff internally.

I tried AfterModuleCreate, but the hook wasn't triggered after adding an order from the admin dashboard. I also added some lines of codes that should add an entry into the Modules Log.

No entries were added so I assumed it did not work.

 

So what hook should I use? Why can't WHMCS just make a hook that is executes after an order has been placed and checked out (completed), regardless of it being paid or not.

$params should provide us those value about the payment and whether it's from admin or client. Or just make two separate hooks for that.

 

But anyway, I have to make do with just what I have right now. I'm certain that AfterModuleCreate is the right one but I still can't get it to work.

Share this post


Link to post
Share on other sites

This hookpoint is executed any time the _ModuleCreate function is ran. This would be any time a module is provisioned. This would happen when a staff member manually presses the Create button from the Client's Products/Services account, when a customer places an order and the Run Module Create function is executed.

 

If an administrator creates an order, this would run when the administrator Accepts the order and the Run Module Create box is ticked. This only runs, however, if the creation function is successful. 

Share this post


Link to post
Share on other sites

To answer the original question of what triggers the hook 'AfterModuleCreate', is successful ModuleCreate function. This hook would execute upon successful completion of ModuleCreate function.

Share this post


Link to post
Share on other sites

Hi, sorry for the bump. Not sure if I should make a new thread since I asked the question in this thread although the question is a different question than the one in the OP. I explained the need in the 2nd post, however.

Anyway, the question was, is there any hook that I can use that would trigger immediately after an Admin created a new order into a customer's account? I want to use the hook to run some custom codes or scripts and then send out an email to the customer about the new order which the Admin added into their account.

Thank you in advance!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

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