fwaggle Posted March 9, 2009 Share Posted March 9, 2009 Hi all, I originally created a support ticket (truthfully each and every time I've dealt with WHMCS I've been half asleep, I wasn't even aware there was a forum), but I thought I'd post here because more eyes might help. I've written a server module, to automatically provision new accounts on a proprietary control panel we developed in house. Once I figured out the API format (could really use some more documentation to be honest) it was rather trivial to write, and it works great except for a couple of little gripes. I have no idea how to cause it to emit an email, save using php's mail() function from inside the module. I can create a template, but I can't seem to cause WHMCS to send one out, which is probably just as well because... I also can't figure out how to pass certain information back to WHMCS from the module. There's things (such as the port number) which are assigned automatically by the server who's panel I connect to. The server is also selected depending on what the user's preferred location, which is set via a custom field in the product. To be specific, I need to send the user an IP, a port, and two passwords - how the heck do I pass this information back to WHMCS? Ideally I'd like to be able to check the server I connected to and automatically add their account to that server, but I can't figure out how to do any of this stuff. The support ticket response was: You would need to use product custom fields to pass an overrideable value.Product Custom fields are passed to the server module functions This gave me something to think on, and I looked around quite a bit, but I can't find any way to override a custom field - I even tried redefining my _create() function to have $params passed by reference, no go! Absolutely nothing I do inside the module makes any difference inside WHMCS after the module's done running. So what I do at the moment is the module_create() function connects to a server on a best guess based on the user's preferred location. If they pick "any", it randomly picks one. The module gives the password to the server and tells it to provision. The XML response contains the IP, port, the password supplied as well as the additional password (randomly generated), which the module then arranges into an email, sends and returns success. I'd really like to have the email be from a template, logged, and have the service automatically assigned to the correct server. Is this possible? Anyone got any tips for accomplishing this? Apologies for the wall of text. 0 Quote Link to comment Share on other sites More sharing options...
snelweg Posted March 19, 2009 Share Posted March 19, 2009 the lack of documentation is indeed rather sad. I guess the only thing you can do is to directly 'fill' tblcustomfields with your value (sql) in the create_ call. After that the value will be available in whmcs. 0 Quote Link to comment Share on other sites More sharing options...
dan.trainor Posted April 10, 2009 Share Posted April 10, 2009 Hi - Unfortunately, that's exactly what I'm doing. Just thought I'd chime in and make you even more depressed. I found this post after two days of hard hacking on this. I'll be back to respond if I make any more headway. Thanks! -dant 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.