Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MailerTestCommand.php

function MailerTestCommand::configure

Overrides Command::configure

File

vendor/symfony/mailer/Command/MailerTestCommand.php, line 34

Class

MailerTestCommand
A console command to test Mailer transports.

Namespace

Symfony\Component\Mailer\Command

Code

protected function configure() : void {
    $this->addArgument('to', InputArgument::REQUIRED, 'The recipient of the message')
        ->addOption('from', null, InputOption::VALUE_OPTIONAL, 'The sender of the message', 'from@example.org')
        ->addOption('subject', null, InputOption::VALUE_OPTIONAL, 'The subject of the message', 'Testing transport')
        ->addOption('body', null, InputOption::VALUE_OPTIONAL, 'The body of the message', 'Testing body')
        ->addOption('transport', null, InputOption::VALUE_OPTIONAL, 'The transport to be used')
        ->setHelp(<<<'EOF'
The <info>%command.name%</info> command tests a Mailer transport by sending a simple email message:

<info>php %command.full_name% to@example.com</info>

You can also specify a specific transport:

    <info>php %command.full_name% to@example.com --transport=transport_name</info>

Note that this command bypasses the Messenger bus if configured.

EOF
);
}
RSS feed
Powered by Drupal