ramf Posted January 15, 2022 Share Posted January 15, 2022 Hi, I need some help with the LogActivity hook. I want to trigger the hook only when in the description there is `Email Sending Failed ` error. I guess I should add some IF statement - but don't know how to do it....This is my code How can I trigger it only when the description have the `Email Sending Failed` information? Thanks for your help! 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted January 16, 2022 Share Posted January 16, 2022 Hook is already been triggered when a logActivity is been created. What else you want to do in it ? 0 Quote Link to comment Share on other sites More sharing options...
ramf Posted January 16, 2022 Author Share Posted January 16, 2022 (edited) 20 minutes ago, pRieStaKos said: Hook is already been triggered when a logActivity is been created. What else you want to do in it ? I want to trigger it only for `Email Sending Failed ` error and then send the information to another system. Any way I found the solution and updated the code accordingly. Thanks! Edited January 16, 2022 by ramf 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted January 16, 2022 Share Posted January 16, 2022 logActivity is been triggered by WHMCS (or modules/hooks). With this hook index, you can catch the description and then run your code. Just use strpos on $vars[‘desciption’] 1 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.