spatie / mailcoach-support

Questions and support for Mailcoach
https://mailcoach.app
31 stars 2 forks source link

Bulk subscribe seems to be limited to 6500 users exactly #299

Closed LorenzoSapora closed 3 years ago

LorenzoSapora commented 3 years ago

I attempted to quickly create an emaillist from a user list of 100k, using:

        $emailList = EmailList::find(1);

        $users = User::where('status', '<>', '3')->get();

        foreach($users as $user)
        {
            $emailList->subscribe($user->email, [
                'first_name' => $user->first_name,
                'last_name' => $user->last_name,
            ]);
        }

But it stopped after 6500. I tried chunking it for a sanity check

        $emailList = EmailList::find(1);

        $users = User::where('status', '<>', '3')->get();

        foreach($users->chunk(1000) as $chunked)
        {
             foreach($chunked as $user)
             {
                 $emailList->subscribe($user->email, [
                     'first_name' => $user->first_name,
                     'last_name' => $user->last_name,
                 ]);
             }
         }

It still stopped at 6500. A quick grep shows no such limit in the codebase, but consistently hitting the 6500 limit.

Edit: I can manually add more subscribers, so it doesn't appear to be a MC limit for email lists, but still perplexing. Any idea what could be causing this?

riasvdv commented 3 years ago

How long did your script run? Looks to me that it is a PHP execution timeout

LorenzoSapora commented 3 years ago

It didn't timeout, but let me check.

Aha, would you believe that it was actually a bad email address at user 6501? Hilarious. Made it look like some limitation, when it was just bad data.

Closing.