You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.
By default, the mailer will use the 'default' value for the mailer option.
->addOption('mailer', null, InputOption::VALUE_REQUIRED, 'The mailer name', 'default')
When executing swiftmailer: email: send , i was not prompt to enter/confirm/validate my 'mailer', and hence the command was throwing an error :
PHP Fatal error: Call to undefined method Symfony\Bundle\SwiftmailerBundle\Command\NewEmailCommand::getOption() in /Users/ZCJ/Sites/Spade/vendor/symfony/swiftmailer-bundle/Command/NewEmailCommand.php on line 61
That was because my mail service was configured as "gmail" and an exception was being raised in:
$mailerServiceName = sprintf('swiftmailer.mailer.%s', $input->getOption('mailer'));
if (!$this->getContainer()->has($mailerServiceName)) {
throw new \InvalidArgumentException(sprintf('The mailer "%s" does not exist', $this->getOption('mailer')));
}
I think it would be great if we can handle the mailer in the interact dialog.
For that, I am proposing something minor like :
if('default' === $input->getOption('mailer')){
$input->setOption('mailer',$dialog->ask($output, sprintf('Mailer (Enter for 'default'): '),'default'));
}
The text was updated successfully, but these errors were encountered:
By default, the mailer will use the 'default' value for the mailer option.
->addOption('mailer', null, InputOption::VALUE_REQUIRED, 'The mailer name', 'default')
When executing swiftmailer: email: send , i was not prompt to enter/confirm/validate my 'mailer', and hence the command was throwing an error :
PHP Fatal error: Call to undefined method Symfony\Bundle\SwiftmailerBundle\Command\NewEmailCommand::getOption() in /Users/ZCJ/Sites/Spade/vendor/symfony/swiftmailer-bundle/Command/NewEmailCommand.php on line 61
That was because my mail service was configured as "gmail" and an exception was being raised in:
$mailerServiceName = sprintf('swiftmailer.mailer.%s', $input->getOption('mailer'));
if (!$this->getContainer()->has($mailerServiceName)) {
throw new \InvalidArgumentException(sprintf('The mailer "%s" does not exist', $this->getOption('mailer')));
}
I think it would be great if we can handle the mailer in the interact dialog.
For that, I am proposing something minor like :
if('default' === $input->getOption('mailer')){
$input->setOption('mailer',$dialog->ask($output, sprintf('Mailer (Enter for 'default'): '),'default'));
}
The text was updated successfully, but these errors were encountered: