I am using Monolog with HTML email formatter to send some alerts.
monolog:
# ....
symfony_mailer:
type: symfony_mailer
from_email: "%admin_email%"
to_email: "%admin_email%"
subject: "A problem occurred"
level: info
content_type: text/html
formatter: monolog.formatter.html
I want sending email with a specific email account defined as transport “monolog”
# config/packages/mailer.yaml
framework:
mailer:
transports:
main: '%env(MAILER_DSN)%'
monolog: '%env(MAILER_DSN_IMPORTANT)%'
For that, I can specify a service to use in the monolog config like mailer: 'monolog_mailer_transport'
but I am not able to define the service to use the “monolog” transport.
service:
# ....
# NOT WORKING : HOW TO DEFINE THE SERVICE TO USE THE TRANSPORT 'MONOLOG' ?
monolog_mailer_transport:
class: SymfonyComponentMailerTransportTransportInterface
factory: ['@mailer.transports', 'get']
arguments: ['monolog']