Skip to content

Commit

Permalink
[SwiftmailerBundle] fixed the send email command when the queue does …
Browse files Browse the repository at this point in the history
…not extends Swift_ConfigurableSpool
  • Loading branch information
fabpot committed Dec 15, 2011
1 parent 75dfc79 commit 9e38d6a
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -54,8 +54,10 @@ protected function execute(InputInterface $input, OutputInterface $output)

if ($transport instanceof \Swift_Transport_SpoolTransport) {
$spool = $transport->getSpool();
$spool->setMessageLimit($input->getOption('message-limit'));
$spool->setTimeLimit($input->getOption('time-limit'));
if ($spool instanceof \Swift_ConfigurableSpool) {
$spool->setMessageLimit($input->getOption('message-limit'));
$spool->setTimeLimit($input->getOption('time-limit'));
}
$sent = $spool->flushQueue($this->getContainer()->get('swiftmailer.transport.real'));

$output->writeln(sprintf('sent %s emails', $sent));
Expand Down

0 comments on commit 9e38d6a

Please sign in to comment.