alert_email!='') && ($settings->alerts_enabled==1)) { $items = Helper::checkLowInventory(); // Send a rollup to the admin, if settings dictate $recipient = new \App\Models\Recipients\AlertRecipient(); if (($items) && (count($items) > 0) && ($settings->alert_email!='')) { $this->info( trans_choice('mail.low_inventory_alert',count($items)) ); $recipient->notify(new InventoryAlert($items, $settings->alert_threshold)); } } else { if (Setting::getSettings()->alert_email=='') { $this->error('Could not send email. No alert email configured in settings'); } elseif (Setting::getSettings()->alerts_enabled!=1) { $this->info('Alerts are disabled in the settings. No mail will be sent'); } } } }