Jump to content

Server Module Hookpoint InvoiceCreationPreEmail


imaticon

Recommended Posts

Hi,

 

The hookpoint "InvoiceCreationPreEmail" does not work within a "hooks.php" file in the server module folder.

 

Test script: hooks.php

Location: Upload into a server module

Reproduce: Add a new Order (admin or client)

 

function testhook($vars) {
   $action = "InvoiceCreationPreEmail";
   $requeststring = "";
   $responsedata = $vars;
   logModuleCall("testhook",$action,$requeststring,$responsedata);
}
add_hook('InvoiceCreationPreEmail',1,'testhook');

 

Result: Module log empty

 

The hookpoint "InvoiceCreationPreEmail" works correctly if you place the hooks.php file into /includes/hooks/ folder.

 

Result:

 

Array
(
   [source] => autogen
   [user] => 1
   [invoiceid] => 103
)

 

This happens since a very very long time, even in whmcs 5.2 and 5.3

 

I'm very suprised that this is still not working in WHMCS v6

 

Regards,

Marco

Link to comment
Share on other sites

Hello Marco,

 

Have you confirmed the hook is loaded after uploading in the via the Hooks Debug logging? As is described in the discussion here:

 

http://docs.whmcs.com/Hooks#Module_Hooks

 

"Note to Developers: Hook files in module folders are only called for active modules. And active modules that contain hooks are cached. So if you add a hooks file to a module retrospectively, once the module is already active, then before the system will detect and start running that module, you must edit and resave either the addon module configuration, product configuration or domain registrar configuration for the respective module for it to be detected."

 

Have a great day,

 

Nate C

Link to comment
Share on other sites

Hello Marco,

 

This really is a separate report. More then that its a partial report, you don't say anything about how the order is created, the automation settings in your test, if addons, promo codes, or other things are involved. This is why I lock threads reply after something is worked out. I did a quick scan of the code and the hook should be triggered as the order is processed to generate an invoice. If you can provided detailed reproduction steps and want to make a new thread please do so, alternatively you can open a support ticket and work with a team who is online 24/7.

 

I am going to close this thread now, have a great day.

 

Nate C

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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