Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Mailer] Add compatibility for Mailtrap's sandbox#61315
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
Sorry about that@Chris53897. Mistake resolved with commit. |
src/Symfony/Component/Mailer/Bridge/Mailtrap/Transport/MailtrapApiTransport.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Mailer/Bridge/Mailtrap/Transport/MailtrapApiTransport.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Mailer/Bridge/Mailtrap/Transport/MailtrapApiTransport.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Mailer/Bridge/Mailtrap/Transport/MailtrapTransportFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Thanks for working on this@KiloSierraCharlie. There's still some logic needed to change the endpoint host if an |
Suggested changes made as part of PRsymfony#61315.
Apoligies@kbond &@nicolas-grekas - new commite767fd6 with all changes submitted to branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I wonder: it isn't super clear that when you have an inboxId, the sandbox is used. Could it lead to some confusion as to why the live isn't being used.
Would it make more sense to have separate DSN schemes for the sandbox?
# SANDBOX SMTPMAILER_DSN=mailtrap+sandbox+smtp://PASSWORD@default# SANDBOX APIMAILER_DSN=mailtrap+sandbox+api://INBOX_ID:TOKEN@defaultsrc/Symfony/Component/Mailer/Bridge/Mailtrap/Transport/MailtrapApiTransport.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Mailer/Bridge/Mailtrap/Transport/MailtrapApiTransport.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Mailer/Bridge/Mailtrap/Tests/Transport/MailtrapApiTransportTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Mailer/Bridge/Mailtrap/Transport/MailtrapApiTransport.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
@kbond Thanks for the suggestion, I think you're right - adding a seperate DSN makes it clearer as to which Mailtrap environment is being used. I've created a new transport which extends the original. Unit tests for this new DSN added also. |
Add documentation relating to the Mailtrap sandbox implementation in 7.4 (symfony/symfony#61315).
I'll get there eventually 😢 |
Suggested changes made as part of PRsymfony#61315.
fe922e3 to27bdb25CompareAccidentally merge-commit'd instead of rebasing hence the force-push... |
src/Symfony/Component/Mailer/Bridge/Mailtrap/Transport/MailtrapApiTransport.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
27bdb25 toa8fa408CompareSuggested changes made as part of PRsymfony#61315.
src/Symfony/Component/Mailer/Bridge/Mailtrap/Transport/MailtrapApiTransport.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Mailer/Bridge/Mailtrap/Transport/MailtrapApiTransport.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Mailer/Bridge/Mailtrap/Transport/MailtrapTransportFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
8ab82fe to73cab0eCompareSuggested changes made as part of PRsymfony#61315.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM. Let's make sure we make the inboxId required.
src/Symfony/Component/Mailer/Bridge/Mailtrap/Transport/MailtrapApiSandboxTransport.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Mailer/Bridge/Mailtrap/Transport/MailtrapApiSandboxTransport.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Mailer/Bridge/Mailtrap/Transport/MailtrapTransportFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
ro0NL commentedAug 18, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
why not a single DSN scheme + optional DSN inboxId parameter?https://github.com/railsware/mailtrap-php/tree/main/src/Bridge/Symfony#sandbox |
KiloSierraCharlie commentedAug 18, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The initial PR was with a single DSN and optional inboxId param, howeverit was suggested to implement a separate DSN to ensure that prod/sandbox enviornments are clearer to identify for users. |
Thank you@KiloSierraCharlie. |
7ed3a4b intosymfony:7.4Uh oh!
There was an error while loading.Please reload this page.
… and sandbox API (xabbuh)This PR was merged into the 7.4 branch.Discussion----------[Mailer] use the same transport for both Mailtrap's live and sandbox API| Q | A| ------------- | ---| Branch? | 7.4| Bug fix? | no| New feature? | no| Deprecations? | no| Issues || License | MITI agree with#61315 (review) on having distinct DSN schemes for both the live and the sandbox API, but I'd prefer not to increase the maintenance costs for us by using distinct transport classes.Commits-------5f577fb use the same transport for both Mailtrap's live and sandbox API
…SierraCharlie)This PR was squashed before being merged into the 7.4 branch.Discussion----------[Mailer] Document Mailtrap's sandbox compatibilityDocumentation forsymfony/symfony#61315 - sandbox compatibility for Mailtrap bridge.Commits-------8b5ef68 [Mailer] Document Mailtrap's sandbox compatibility
Mailtrap's sandbox requires the Inbox ID to be passed as part of the URI, which has previously been neglected.
Previously#61305 but I messed up when re-basing to 7.4.
Updates with appropriate tests and changelog.