Skip to content

Instantly share code, notes, and snippets.

@ecentinela
Created January 9, 2013 09:25
Show Gist options
  • Save ecentinela/4491826 to your computer and use it in GitHub Desktop.
Save ecentinela/4491826 to your computer and use it in GitHub Desktop.
The memory spool is flushed on the kernel.terminate event that occurs after a response was sent. Seems that this event is not called on commands. Seen on http://stackoverflow.com/questions/13122096/unable-to-send-e-mail-from-within-custom-symfony2-command-but-can-from-elsewhere
$this
->getContainer()
->get('mailer')
->getTransport()
->getSpool()
->flushQueue(
$this
->getContainer()
->get('swiftmailer.transport.real')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment