Jump to content

What triggers AfterModuleCreate?


EpoxyElegant

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.

Link to comment
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.

Link to comment
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. 

Link to comment
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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

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