]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6297
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 16 Jul 2024 16:54:53 +0000 (18:54 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 16 Jul 2024 16:54:53 +0000 (18:54 +0200)
app/Models/TeamEmails.php

index f62e6317f5ff411d29e883a0fa1f56d4b3b80896..bab2c1aad59501b9f1d50f2a3bdf7514a063b0cd 100644 (file)
@@ -202,8 +202,19 @@ class TeamEmails extends CubistMagicAbstractModel
         $freeproviders = \Illuminate\Support\Facades\Cache::rememberForever('freeemailproviders', function () {
             return Text::splitLines(file_get_contents('https://gist.githubusercontent.com/drakodev/e85c1fd6d9ac8634786d6139e0066fa0/raw/1f345fa275fafda8196af754674fcf04d05b7fba/free-disposable-email-providers.txt'));
         });
+
+
+        $emails = [];
+        foreach (Company::withoutGlobalScopes()->where('created_ok', '1')->get() as $company) {
+            $emails = array_merge($emails, $company->getEmails());
+        }
+
         foreach (User::withoutGlobalScopes()->where('created_ok', '1')->where('enabled', '1')->get() as $user) {
-            $email = trim(mb_strtolower($user->email));
+            $emails = array_merge($emails, $user->getEmails());
+        }
+
+
+        foreach ($emails as $email) {
             $e = explode('@', $email);
             if (count($e) < 2) {
                 continue;
@@ -218,6 +229,7 @@ class TeamEmails extends CubistMagicAbstractModel
 
         $res = array_unique($res);
         sort($res);
+        dd($res);
         return $res;
     }
 }