-
Notifications
You must be signed in to change notification settings - Fork 1
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
Handle rate limiting #2
Comments
Haven't run into that myself so far. I'm using the Symfony adapter, which in turn uses the /v1/email API function https://github.com/symfony/mailer-send-mailer/blob/50f492dc46cac33a86cbb7e061d43220fb3af009/Transport/MailerSendApiTransport.php#L48. I'm not sure if I could handle these errors from the adapter since the actual sending in done through Craft - apart from implementing the API myself, which I don't want to do at this moment. |
It looks like you could catch the |
Not sure where I could catch that in the plugin as my code isn't doing the sending. I'm only adding the transport but Craft is doing the sending. Have you done this in another mail adapter @bencroker? |
Ok, I see what you mean now. To be able to catch the exceptions, you’d need to define the transport yourself, rather than use MailerSendApiTransport.
I tend to define mailer transports myself so I can customise the behaviour, although I understand why you wouldn’t want to. |
The MailerSend API enforces daily request quotas and rate limits. I’ve received support requests from people experiencing failed sendouts using the Campaign plugin (putyourlightson/craft-campaign#451, putyourlightson/craft-campaign#462) due to the rate limits.
Have you considered adding handling of
429 - Too many requests
errors? I’m not sure whether the desired result would be to avoid such errors completely by building throttling into the plugin, adding a delay on encountering such errors, or simply better handling of the errors, but I’d be interested in hearing your thoughts and whether this is something you have considered.The text was updated successfully, but these errors were encountered: