Skip to content

Instantly share code, notes, and snippets.

@Ph3nol
Forked from arnaud-lb/flush.php
Created September 15, 2012 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ph3nol/3728280 to your computer and use it in GitHub Desktop.
Save Ph3nol/3728280 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