Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

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 3eb045c commit bcd342d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Command/SendEmailCommand.php
Original file line number Diff line number Diff line change
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 bcd342d

Please sign in to comment.