Skip to content

Instantly share code, notes, and snippets.

@arnaud-lb
Created September 15, 2012 10:14
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save arnaud-lb/3727254 to your computer and use it in GitHub Desktop.
Save arnaud-lb/3727254 to your computer and use it in GitHub Desktop.
flush email queue from symfony command
<?php
protected function flushQueue()
{
$container = $this->getContainer();
$transport = $container->get('mailer')->getTransport();
$spool = $transport->getSpool();
$spool->flushQueue($container->get('swiftmailer.transport.real'));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment