In my symfony2 application I have two mailers, and I'd like to use the non-default mailer to send monolog errors. Errors are being sent as expected now, but I can't get it to send to the non default mailer.
Here's my Swift Mailer configuration, in which I'd like to send errors using the "phpmail" mailer:
Swiftmailer Configuration
default_mailer: authsmtp
mailers:
authsmtp:
transport: %mailer_transport%
host: %mailer_host%
username: %mailer_user%
password: %mailer_password%
port: %mailer_port%
spool: { type: memory }
phpmail:
transport: smtp
host: 127.0.0.1
spool: { type: memory }
And the relevant part of my Monolog configuration:
handlers:
mail_on_errors:
type: fingers_crossed
action_level: critical
handler: buffered
buffered:
type: buffer
handler: swift
swift:
type: swift_mailer
mailer: swiftmailer.mailer.phpmail
from_email: %from_email_address%
to_email: [ %errors_receiving_address% ]
subject: An Error Occurred!
level: debug
You can see I tried to get this to work by adding "mailer: swiftmailer.mailer.phpmail" to the swift monolog handler----this isn't covered in the docs (that i can find anyway) so I just made this up, and it doesn't error out, but it also doesn't use the phpmail handler.
If anyone knows the proper configuration to get this to work I'd appreciate it!
handlers.swift.mailer
toswiftmailer.mailer.phpmail
, but it shoud beswiftmailer.mailers.phpmail
(note the 's' at the end of 'mailers'), no? – AnthonyB