virtudraft / virtuNewsletter

Yet another MODX's newsletter package
9 stars 3 forks source link

Mailgun spinning and doesn't complete #44

Closed matdave closed 8 years ago

matdave commented 8 years ago

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.

matdave commented 8 years ago

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

image

goldsky commented 8 years ago

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

matdave commented 8 years ago

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.

matdave commented 8 years ago

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.

matdave commented 8 years ago

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

goldsky commented 8 years ago

I've used that, but it didn't parse MODX's output filter.

goldsky commented 8 years ago

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

matdave commented 8 years ago

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.

goldsky commented 8 years ago

May be i can add a setting to make it optional