Project

General

Profile

Actions

Bug #87648

closed

SendEmailCommand with wrong Parameter

Added by Sascha Grötzner almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
CLI
Target version:
-
Start date:
2019-02-04
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Using swiftmail:spool:send with parameters produces an error "option does not accept a value"

./typo3/sysext/core/bin/typo3 swiftmailer:spool:send --message-limit=2
The "--message-limit" option does not accept a value.  
swiftmailer:spool:send [--message-limit] [--time-limit] [--recover-timeout]

->the class SendEmailCommand::configure uses wrong parameter:
is:

use Symfony\Component\Console\Input\InputArgument;
...
protected function configure()
    {
        $this
            ->setDescription('Sends emails from the spool')
            ->addOption('message-limit', null, InputArgument::REQUIRED, 'The maximum number of messages to send.')
            ->addOption('time-limit', null, InputArgument::REQUIRED, 'The time limit for sending messages (in seconds).')
            ->addOption('recover-timeout', null, InputArgument::REQUIRED, 'The timeout for recovering messages that have taken too long to send (in seconds).');
    }

should be: (InputArgument -> InputOption)

use Symfony\Component\Console\Input\InputOption;
...
protected function configure()
    {
        $this
            ->setDescription('Sends emails from the spool')
            ->addOption('message-limit', null, InputOption::VALUE_REQUIRED, 'The maximum number of messages to send.')
            ->addOption('time-limit', null, InputOption::VALUE_REQUIRED, 'The time limit for sending messages (in seconds).')
            ->addOption('recover-timeout', null, InputOption::VALUE_REQUIRED, 'The timeout for recovering messages that have taken too long to send (in seconds).');
    }

Actions

Also available in: Atom PDF