virtudraft/virtuNewsletter

Mailgun spinning and doesn't complete

Closed this issue · 9 comments

I manually added the mailgun-php library, and it sort of worked. The mail only ended up sending out to about 200 of the 700 subscribers. When I hit send all it just spins forever, and doesn't get any post-back. I don't see any errors in any logs.

After testing it out with a smaller send group (200) I received the following error on callback

image

yes, you need to add the library manually first.
have you run the composer?

Yes, I followed the steps here https://github.com/mailgun/mailgun-php to install Mailgun-php 1.7.2. It sends some, however it doesn't change the status, and returns the above error. I have modified the mailgun library to provide further error reporting to see what missing required parameters are halting it. Testing is scheduled for tomorrow.

After adding some extra logging, I was able to find an email address that mailgun wasn't liking. This was causing it to stop sending other emails.

After correcting the mal-formatted email, it sent all of them, however it never stopped spinning on the manager side after it completed.

After further research, I am noticing you are using the standard "sending" method iterating over each email individually. It might be more performant to take a similar approach to how the mandrill process is set up, and send via Mailgun's "batch" method https://documentation.mailgun.com/user_manual.html#batch-sending

How many limit did you set on System Settings? 30 is my recommendation, because of this parsing.

When it was on Mandrill we had it set to send 700 at a time. We can't use the cron settings, because the emails need to go out at a specific time each week day. Setting it lower means we have to manually cycle through the whole lot.