monolog-bundle
monolog-bundle copied to clipboard
Monolog with Symfony Mailer fails on multiple mail receiver when pass mails as the environment value
Hi,
I tried the create mail notifications that sending on application fail 50x
, so I want to send this notification to 2 different developers and I defined the environment value in .env
like this:
[email protected],[email protected]
and the monolog configuration is like this:
symfony_mailer:
type: symfony_mailer
from_email: '%env(EXCEPTION_MAIL_SENDER)%'
to_email: '%env(csv:EXCEPTION_NOTIFICATION_MAILS)%'
subject: 'An Error Occurred on Project X! %%message%%'
level: debug
formatter: monolog.formatter.html
content_type: text/html
then the application fails.
Invalid type for path "monolog.handlers.symfony_mailer.to_email.0". Expected one of "bool", "int", "float", "string", but got "array".
Same error throws on JSON
parser... Am I defining values as malformed or is this a bug/unsupported usage?
same problem
Same here in SF 5.4
Same here in 6.3, while it's specifically mentionned in the documentation that passing an array of emails is allowed:
https://symfony.com/doc/current/logging/monolog_email.html
I think this is related to using an env placeholder instead of a build-time array here.
yes, using an array directly in yaml is indeed working. The problem really is when it comes to using a .env variable as @ahmetcelikezer mentionned