[8.x] Add Failover Swift Transport driver #38344
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sometimes mailgun is not available in our area. The most recent one in the EU was on Aug 2 for ~2 hours and the one before that was on May 29 for ~5 hours (https://status.mailgun.com/). In each cases our clients might lost users by not getting immediate emails. With a "failover" mail transport we could fallback to a different transport driver in the future and help our clients not to lose users.
Swift_FailoverTransport
is already battle tested and I was able to provide backward compatibility for "Laravel <= 6.x style mail configuration files".This feature was requested in 2014 but it was rejected with a comment "No plans to implement this currently.". #3374
My original plan was to develop a provider (https://github.com/coding-socks/laravel-mail-failover) but the whole logic is so simple that in my opinion this could be added to the core library. If you disagree I can still release my lib on packagist.