diff --git a/src/applications/metamta/management/PhabricatorMailManagementVolumeWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementVolumeWorkflow.php index dcc548e0f5..f0b0254f84 100644 --- a/src/applications/metamta/management/PhabricatorMailManagementVolumeWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementVolumeWorkflow.php @@ -7,11 +7,18 @@ final class PhabricatorMailManagementVolumeWorkflow $this ->setName('volume') ->setSynopsis( - pht('Show how much mail users have received in the last 30 days.')) + pht('Show how much mail users have received recently.')) ->setExamples( '**volume**') ->setArguments( array( + array( + 'name' => 'days', + 'param' => 'days', + 'default' => 30, + 'help' => pht( + 'Number of days back (default 30).'), + ), )); } @@ -19,7 +26,16 @@ final class PhabricatorMailManagementVolumeWorkflow $console = PhutilConsole::getConsole(); $viewer = $this->getViewer(); - $since = (PhabricatorTime::getNow() - phutil_units('30 days in seconds')); + $days = (int)$args->getArg('days'); + if ($days < 1) { + throw new PhutilArgumentUsageException( + pht( + 'Period specified with --days must be at least 1.')); + } + + $duration = phutil_units("{$days} days in seconds"); + + $since = (PhabricatorTime::getNow() - $duration); $until = PhabricatorTime::getNow(); $mails = id(new PhabricatorMetaMTAMailQuery()) @@ -95,7 +111,9 @@ final class PhabricatorMailManagementVolumeWorkflow $table->draw(); echo "\n"; - echo pht('Mail sent in the last 30 days.')."\n"; + echo pht( + 'Mail sent in the last %s day(s).', + new PhutilNumber($days))."\n"; echo pht( '"Unfiltered" is raw volume before rules applied.')."\n"; echo pht( diff --git a/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php b/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php index 9ac0d0b591..d9397d80c8 100644 --- a/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php +++ b/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php @@ -1369,6 +1369,11 @@ final class PhabricatorUSEnglishTranslation 'This action has no effect on targets: %2$s.', ), + 'Mail sent in the last %s day(s).' => array( + 'Mail sent in the last day.', + 'Mail sent in the last %s days.', + ), + ); }