1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 05:12:41 +01:00

Minor tweaks to bin/mail send-test

Summary: Clean up some arg handling stuff.

Test Plan: Used this while debugging.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D10314
This commit is contained in:
epriestley 2014-08-21 11:25:44 -07:00
parent f50ba4fb07
commit 7d31ea7c55

View file

@ -79,6 +79,13 @@ final class PhabricatorMailManagementSendTestWorkflow
$tos = $args->getArg('to'); $tos = $args->getArg('to');
$ccs = $args->getArg('cc'); $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); $names = array_merge($tos, $ccs);
$users = id(new PhabricatorPeopleQuery()) $users = id(new PhabricatorPeopleQuery())
->setViewer($viewer) ->setViewer($viewer)
@ -103,6 +110,10 @@ final class PhabricatorMailManagementSendTestWorkflow
} }
$subject = $args->getArg('subject'); $subject = $args->getArg('subject');
if ($subject === null) {
$subject = pht('No Subject');
}
$tags = $args->getArg('tag'); $tags = $args->getArg('tag');
$attach = $args->getArg('attach'); $attach = $args->getArg('attach');
$is_bulk = $args->getArg('bulk'); $is_bulk = $args->getArg('bulk');
@ -110,7 +121,6 @@ final class PhabricatorMailManagementSendTestWorkflow
$console->writeErr("%s\n", pht('Reading message body from stdin...')); $console->writeErr("%s\n", pht('Reading message body from stdin...'));
$body = file_get_contents('php://stdin'); $body = file_get_contents('php://stdin');
$mail = id(new PhabricatorMetaMTAMail()) $mail = id(new PhabricatorMetaMTAMail())
->addTos($tos) ->addTos($tos)
->addCCs($ccs) ->addCCs($ccs)