-
-
Notifications
You must be signed in to change notification settings - Fork 237
Add Symfony Mailer support #354
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
Conversation
6af329f
to
294cae1
Compare
@acasademont thank you for working on this, i can help test/try it on a project if needed :) |
Can I help somehow to make this PR accepted and included in the next release? |
Same @mmarton ... |
@lyrixx friendly ping :) (cf slack discussion) // composer.json
// inside a symfony 5.1 app
- symfony/mailer v5.1.5
- symfony/monolog-bundle v3.5.0 + manual edit files from PR changes # config/packages/dev/monolog.yaml
# from https://symfony.com/doc/current/logging/monolog_email.html but adapted for "symfony_mailer"
monolog:
handlers:
main:
type: fingers_crossed
action_level: critical
handler: deduplicated
deduplicated:
type: deduplication
handler: symfony_mailer
symfony_mailer:
type: symfony_mailer
from_email: 'error@example.com'
to_email: 'error@example.com'
subject: 'An Error Occurred! %%message%%'
level: debug
formatter: monolog.formatter.html
content_type: text/html // a controller
/**
* @Route("/mailer-logger", name="mailer_logger")
*/
public function log(LoggerInterface $logger)
{
$logger->debug('A "debug"', ['foo' => 'bar']);
$logger->notice('A "notice"', ['1' => 1]);
$logger->error('A "error"');
$logger->critical('A "critical"');
// ...
} results👍 |
@noniagriconomie Thanks a lot for testing 👍🏼 |
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.
@acasademont thanks for your first PR 👍🏼
@noniagriconomie sorry for the late reply! quite busy on other fronts, something you tink needs to be changed? |
no, i was checking this PR (as i want also to remove swiftmailer but still use logger mail feature) |
Note: I rebased your PR to ensure it's green, once it's green, we'll merge it 👍🏼 |
Thanks for your work on this new feature! |
thank you! |
I testing the new feature with the same config of @noniagriconomie in one of my project, but it's not working...
I have this error Any one have idea why ? Thanks |
@devcut imo the bundle v3.6.0 will allow to use it (via config like normal) (in preparation cf https://github.com/symfony/monolog-bundle/pull/362/files#diff-4ac32a78649ca5bdd8e0ba38b7006a1eR1) when testing localy, i updated manually the bundle code to test it (related to #354 (comment) did you do that on your side? |
Ahhh, I thought it was already available in version 3.5.0 ! I will wait for version 3.6.0 🤓 Thanks you for your explication @noniagriconomie. |
the v3.6.0 has been released, enjoy 🎉 |
It's working, thank you for this release @lyrixx. 😍 |
…(noniagriconomie, OskarStark) This PR was merged into the 5.1 branch. Discussion ---------- Document usage of Symfony Mailer for error email Related to symfony/monolog-bundle#354 and symfony/monolog-bundle#354 (comment) ---------- Should we also document that for the `v4.4` of this page, it will not be possible? The `Symfony\Bridge\Monolog\Handler\MailerHandler` was added in `v5.1` (symfony/symfony#33456) Because the wording `compatible yet` implies that it will be compatible in the future Thank you edit: I do not understand the `DOCtor-RST` check here :s Commits ------- 202b9e6 Update message d20f07c Fix: DOXtor-RST 922932f Makes DOCtor-RST happy 3df4d9e Document usage of Symfony Mailer for error email
Add support for the new symfony mailer directly on the bundle after the MailerHandle was added to the bridge on symfony/symfony#33456
Also this can make symfony/symfony-docs#13077 move forward
Tests are failing due to incompatible phpunit versions, not sure how to fix this...