problem with registerPlugin for swiftmailer

I have a plugin that I made :

class SwiftTransportExceptionListener implements Swift_Events_TransportExceptionListener

Basically it logs info when TransportException occurs.

Now I have my own mailManager service that sends emails. I have too mailers inside : mailer_spool_memory (with spool:memory) and mailer_spool_file (with spool:file).

in the constructor of this manager, I register my plugin :

$this->mailer_spool_memory->registerPlugin(new SwiftTransportExceptionListener($this->logger));
$this->mailer_spool_file->registerPlugin(new SwiftTransportExceptionListener($this->logger));

The pluggin works very well with the mailer_spool_memory, but not in the mailer_spool_file (I still get Swift_TransportException when I send emails via console with swiftmailer:spool:send ).

Any idea ?

Thanks in advance !

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *