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

Implement a symfony/mailer handler #1621

Closed
MaximilianKresse opened this issue Dec 14, 2021 · 7 comments · Fixed by #1663
Closed

Implement a symfony/mailer handler #1621

MaximilianKresse opened this issue Dec 14, 2021 · 7 comments · Fixed by #1663
Labels
Milestone

Comments

@MaximilianKresse
Copy link

MaximilianKresse commented Dec 14, 2021

As swiftmailer is abandoned many of us are "forced" to search for an alternative. The recommended alternative is symfony/mailer.

I'm not using the Symfony Framework but only the symfony/mailer. I know there is an implementation inside the monolog-bridge. But the monolog-bridge has some dependencies which I absolutely not need e.g. symfony/http-kernel. So i don't want to require the monolog-bridge as I'm only missing the monolog handler.

Is there a chance we could get an implementation directly inside the monolog package like with the swiftmailer handler?

@stof
Copy link
Contributor

stof commented Dec 14, 2021

AFAIK the monolog package itself has stopped accepting handlers that rely on additional dependencies, as it makes it very hard to manage dependencies (the monolog package cannot require those dependencies, as it would annoy all projects not using that handler). That's also why the wiki has a list of third-party packages related to monolog.

@MaximilianKresse
Copy link
Author

Ok thank you for your answer. That makes sense! I'll take a look at an alternative approach.

@Seldaek
Copy link
Owner

Seldaek commented Mar 6, 2022

Yeah for this I think I may want to make an exception though as email support is kinda core IMO and just relying on mail() makes for a poor UX.

SwiftMailerHandler needs to be deprecated, and MandrillHandler also relies on SwiftMailer being present to build a message so this would need to be updated too.

@Seldaek Seldaek reopened this Mar 6, 2022
@Seldaek Seldaek added this to the 2.x milestone Mar 6, 2022
@Seldaek
Copy link
Owner

Seldaek commented Mar 6, 2022

If someone wants to help with this that'd be great btw.

@driesvints
Copy link
Contributor

I'll answer @dmitry-ivanov's question here. It's true that we don't use Symfony's Mailer directly, just the transports. It's because we already have our own Mailer class with its send method. Changing it would be a really big breaking change to our users.

I'm not too familiar with Monolog's handlers or inner workings so I'm not sure I can answer what's needed to make this work on the Laravel side of things.

@raziel057
Copy link

Please note that with the current implementation of monolog-bridge there is an issue when using SmtpTransport related to the fact that Symfony Mailer use monolog to log in the stop method https://github.com/symfony/symfony/blob/6.1/src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php

symfony/monolog-bundle#405

@Seldaek
Copy link
Owner

Seldaek commented May 3, 2022

See #1663

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

Successfully merging a pull request may close this issue.

5 participants