-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Mailgun implementation does not allow changing of base API url #24987
Comments
At first I thought this could be solved in the same way as #23910, but the mailgun transport doesn't receive an These would be breaking changes. An alternative would be to add a new method to MailgunTransport to force a different base url to be used, but I'm not sure that's a great idea. |
I think the first option with the breaking change makes more sense. |
I would have said the issue needed addressing more urgently than that. The new endpoint from Mailgun is a welcome change for those in the EU wanting to ensure user data doesn't cross outside of the EU (so they don't have to inform and consent users to the fact). Ideally this would be made available to 5.5 LTS too. |
Knowingly merging breaking changes rarely ends well, especially into an LTS release. While it isn't an obvious and direct approach, this can currently be made to work by extending the MailServiceProvider, TransportManager, and MailgunTransport classes in your application, and then overriding the ExtendedMailServiceProvider's Might be the sort of thing that would make a good laravel-related blog post. |
Great, I've set up a simple package to handle this if anyone else would find it of use. |
This should still be fixed in the core for 5.7. It doesn't make sense to support custom endpoints for one mail service but require a package for another service. Thinking about it, it might be worth doing a pass on every service provider to add a way to customize endpoints. Or at least pass in an I won't have time to work on this over the weekend, but maybe someone else can take a crack at it. |
Description:
Mailgun have recently added an Europe region which uses separate endpoints to the main global mailgun URL that is currently set in
/laravel/framework/src/Illuminate/Mail/Transport/MailgunTransport.php
Having the URL hardcoded like this means that people using the default Mailgun implementation cannot change to the Europe region without a lot more work.
Blog post from Mailgun detailing region introduction: https://www.mailgun.com/blog/we-have-a-new-region-in-europe-yall
New endpoints in Mailgun docs: https://documentation.mailgun.com/en/latest/api-intro.html#mailgun-regions
I imagine that ideally the Mailgun API url should be a config item.
The text was updated successfully, but these errors were encountered: