private function sendEmailToPublisherAdminsNoCredits($publisherAdmins, $companyId) { $en = EmailNotification::findNotification("Company", $companyId, EmailNotification::COMPANY_NO_CREDIT); if (empty($en) || !$en->isValidNotification()) { Mail::send('emails.import.no_credits', [], function ($message) use($publisherAdmins) { $emails = array_map(function ($ar) { return $ar["email"]; }, $publisherAdmins->toApiArray()); $message->from('*****@*****.**')->to($emails)->bcc(Config::get("mail.admins"))->subject('[MINT NOTIFICATION - NO CREDITS LEFT]'); }); EmailNotification::createUpdateNotification("Company", $companyId, EmailNotification::COMPANY_NO_CREDIT); } }