Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14660825
D13901.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D13901.diff
View Options
diff --git a/src/applications/metamta/management/PhabricatorMailManagementVolumeWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementVolumeWorkflow.php
--- a/src/applications/metamta/management/PhabricatorMailManagementVolumeWorkflow.php
+++ b/src/applications/metamta/management/PhabricatorMailManagementVolumeWorkflow.php
@@ -7,11 +7,18 @@
$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 @@
$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 @@
$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
--- a/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php
+++ b/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php
@@ -1369,6 +1369,11 @@
'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.',
+ ),
+
);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 13, 2:30 AM (7 h, 38 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6988268
Default Alt Text
D13901.diff (2 KB)
Attached To
Mode
D13901: variable days back for `bin/mail volume`
Attached
Detach File
Event Timeline
Log In to Comment