wdele Posted November 28, 2014 Share Posted November 28, 2014 Hi, I'm developing a provisioning module and I want to send an 'Automatic Setup Failed' email when the setup fails. How can I do that? Thanks! 0 Quote Link to comment Share on other sites More sharing options...
wdele Posted November 29, 2014 Author Share Posted November 29, 2014 ...anyone? 0 Quote Link to comment Share on other sites More sharing options...
mbit Posted November 29, 2014 Share Posted November 29, 2014 Haven't played with prov. modules in a while but... If your createAccount function returns anything else than the word "success", WHMCS should know it's not good and then, depending on a call type, display the error to the admin area or send an email. Email should be sent only on automatic account creations (auto-create on invoice paid) 0 Quote Link to comment Share on other sites More sharing options...
wdele Posted November 29, 2014 Author Share Posted November 29, 2014 (edited) Haven't played with prov. modules in a while but... If your createAccount function returns anything else than the word "success", WHMCS should know it's not good and then, depending on a call type, display the error to the admin area or send an email. Email should be sent only on automatic account creations (auto-create on invoice paid) That's weird. My CreateAccount function basically uses else { if it failed: $result = $errorinfo; But it doesn't send the module error email... Edited November 29, 2014 by wdele 0 Quote Link to comment Share on other sites More sharing options...
wdele Posted November 29, 2014 Author Share Posted November 29, 2014 I've just found out that the module is actually telling WHMCS that the provisioning failed. This is what's in the log: Module Create Failed - Service ID: 55 - Error: Server add failed: Please upload/select a valid ISO or specify a valid iPXE Chain URL But it doesn't send the automatic provisioning failed email. It does with cPanel, eNom, etc., which is in this case a good thing. What's the problem? 0 Quote Link to comment Share on other sites More sharing options...
mbit Posted November 29, 2014 Share Posted November 29, 2014 Did you try to create an account by using the create button in the admin area, or did you try to auto-create it (auto-setup when invoice is paid)? I think the mail goes out only in the 2nd scenario 0 Quote Link to comment Share on other sites More sharing options...
wdele Posted November 29, 2014 Author Share Posted November 29, 2014 Did you try to create an account by using the create button in the admin area, or did you try to auto-create it (auto-setup when invoice is paid)? I think the mail goes out only in the 2nd scenario I've tried both, but they both don't work. 0 Quote Link to comment Share on other sites More sharing options...
wdele Posted December 4, 2014 Author Share Posted December 4, 2014 I've fixed it. 0 Quote Link to comment Share on other sites More sharing options...
mbit Posted December 4, 2014 Share Posted December 4, 2014 Well, feel free to share 0 Quote Link to comment Share on other sites More sharing options...
wdele Posted December 4, 2014 Author Share Posted December 4, 2014 Well, it wasn't that hard after all. Just use the internal API to send the email template and pass the variables 0 Quote Link to comment Share on other sites More sharing options...
mbit Posted December 4, 2014 Share Posted December 4, 2014 Ah...i was hoping you managed to get WHMCS do it on its own once the module returns something else than "success". Anyway..gj 0 Quote Link to comment Share on other sites More sharing options...
wdele Posted December 5, 2014 Author Share Posted December 5, 2014 (edited) Ah...i was hoping you managed to get WHMCS do it on its own once the module returns something else than "success". Anyway..gj Nope, that didn't work. The WHMCS developers said they use the same way I do it as well, so I guess I'd be better off doing that. Thanks for your help, by the way Edited December 5, 2014 by wdele 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.