alert_email!='') && (Setting::getSettings()->alerts_enabled==1)) { $data['data'] = Helper::checkLowInventory(); $data['count'] = count($data['data']); if (count($data['data']) > 0) { \Mail::send('emails.low-inventory', $data, function ($m) { $m->to(explode(',', Setting::getSettings()->alert_email), Setting::getSettings()->site_name); $m->replyTo(config('mail.reply_to.address'), config('mail.reply_to.name')); $m->subject(trans('mail.Low_Inventory_Report')); }); } } else { if (Setting::getSettings()->alert_email=='') { echo "Could not send email. No alert email configured in settings. \n"; } elseif (Setting::getSettings()->alerts_enabled!=1) { echo "Alerts are disabled in the settings. No mail will be sent. \n"; } } } }