Kian Posted May 28, 2015 Share Posted May 28, 2015 Hi, This time I have a question to ask. What's the fastest way to stop WHMCS from sending emails? I need to entirely disable mailing system. I usually disable all Email Templates but maybe there's a fastest way... or not? Maybe there's an awesome checkbox that I have never found Thank you 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 28, 2015 Share Posted May 28, 2015 from within WHMCS, what about changing the SMTP mail settings to blank ? setup --> general settings --> mail untried, but I think it might work. 1 Quote Link to comment Share on other sites More sharing options...
Kian Posted May 28, 2015 Author Share Posted May 28, 2015 Yeees! Thank you very much! 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted May 28, 2015 Share Posted May 28, 2015 what about Action Hooks? <?php function hook_disableAllEmails($vars){ return array("abortsend" => true); } add_hook("EmailPreSend", 1, "hook_disableAllEmails"); ?> 0 Quote Link to comment Share on other sites More sharing options...
adinase Posted June 7, 2021 Share Posted June 7, 2021 How to disable all emails for a particular client group id / group 0 Quote Link to comment Share on other sites More sharing options...
adinase Posted January 21, 2022 Share Posted January 21, 2022 <?php use WHMCS\Database\Capsule; return; function hook_disableAllEmails($vars) { $disallowedGroupID = '1'; // Insert Client Group ID if (!Capsule::select(Capsule::raw('SELECT id FROM tblclients WHERE id = "' . $vars['relid'] . '" AND groupid = "' . $groupid . '" LIMIT 1'))) { $output['abortsend'] = true; return $output; } } add_hook("EmailPreSend", 1, "hook_disableAllEmails"); ?> This is not working !! What might be wrong in this code ?? Any tweaks ?? suggestions ????? Need to disable emails for a particular group 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted January 21, 2022 Share Posted January 21, 2022 Remove the "return;" sitting all alone before all the fun starts. You are basically stopping the rest of the file from executing with that there. 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.