Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sendout getting stuck with Mailgun #138

Closed
samstevens opened this issue May 12, 2020 · 3 comments
Closed

Sendout getting stuck with Mailgun #138

samstevens opened this issue May 12, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@samstevens
Copy link

Describe the bug

If an invalid email address ends up on a mailing list list, mailgun will reject the email and the sendout will become stuck.

Fixing the invalid email address will allow the sendout to continue.

Logs when sendout gets stuck:

Sending of the sendout "ABC Campaign" failed after 3 send attempt(s). Please check that your Campaign email settings are correctly configured and check the error in the Craft log.

To reproduce

Steps to reproduce the behaviour:

  • Create a new campaign/sendout
  • Include a contact with an invalid email address (try a .con or othe varients of invalid email addresses)
  • Send
  • Check logs

Expected behaviour

The sendout should ignore the invalid email address error and continue to send the remaining emails.

This might be a more reliable email validation library
https://github.com/egulias/EmailValidator

Versions

  • Plugin version: 1.15.2
  • Craft version: Craft Pro 3.4.17.1
  • Mailgun Plugin: 1.4.3

Thanks

👍

@samstevens samstevens added the bug Something isn't working label May 12, 2020
@bencroker
Copy link
Collaborator

bencroker commented May 13, 2020

As explained in chat, this is not a bug but expected behaviour. The reasoning is that if Mailgun refuses to send an email maxSendAttempts number of times (set to 3 by default), then something is likely wrong. Rather than continue trying to send the rest of the emails, which could result in Mailgun eventually blacklisting your account, the sendout is stopped with the appropriate warning. You can of course increase maxSendAttempts to whatever number you want.

Ideally, you would not have any invalid email addresses in a mailing list, but these appear to be email addresses that are formatted correctly but whose MX resource record is not found (as in your .con example). If the Campaign plugin was to have to verify the MX resource record of every single email address then it would become slowed down to the point of being unusable. So I think the responsibility should remain on the user to ensure that the email lists contain valid addresses, manually removing any that are refused by Mailgun.

@bencroker bencroker added question Further information is requested and removed bug Something isn't working labels May 13, 2020
@bencroker
Copy link
Collaborator

bencroker commented May 13, 2020

I've improved log messages of failed sendouts in 846c024, adding the email address that failed.

I'm also looking into whether there is a more elegant way to continue the failed sendout without causing too much damage ;)

@bencroker bencroker added enhancement New feature or request and removed question Further information is requested labels May 13, 2020
@bencroker
Copy link
Collaborator

Added the maxSendFailsAllowed config setting in 6bb97ac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants