diff --git a/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php index 1dc68fe93b..d36682e9f8 100644 --- a/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php @@ -79,6 +79,13 @@ final class PhabricatorMailManagementSendTestWorkflow $tos = $args->getArg('to'); $ccs = $args->getArg('cc'); + if (!$tos && !$ccs) { + throw new PhutilArgumentUsageException( + pht( + 'Specify one or more users to send mail to with `--to` and '. + '`--cc`.')); + } + $names = array_merge($tos, $ccs); $users = id(new PhabricatorPeopleQuery()) ->setViewer($viewer) @@ -103,6 +110,10 @@ final class PhabricatorMailManagementSendTestWorkflow } $subject = $args->getArg('subject'); + if ($subject === null) { + $subject = pht('No Subject'); + } + $tags = $args->getArg('tag'); $attach = $args->getArg('attach'); $is_bulk = $args->getArg('bulk'); @@ -110,7 +121,6 @@ final class PhabricatorMailManagementSendTestWorkflow $console->writeErr("%s\n", pht('Reading message body from stdin...')); $body = file_get_contents('php://stdin'); - $mail = id(new PhabricatorMetaMTAMail()) ->addTos($tos) ->addCCs($ccs)