Convert throttling timeout from seconds to a human-readable string [MAILPOET-2015]

This commit is contained in:
wxa
2019-07-19 12:48:21 +03:00
committed by M. Shull
parent 3fbaf8cf3e
commit cfb108d240
4 changed files with 27 additions and 3 deletions

View File

@@ -206,7 +206,8 @@ class Subscribers extends APIEndpoint {
$timeout = SubscriptionThrottling::throttle();
if ($timeout > 0) {
throw new \Exception(sprintf(__('You need to wait %d seconds before subscribing again.', 'mailpoet'), $timeout));
$time_to_wait = SubscriptionThrottling::secondsToTimeString($timeout);
throw new \Exception(sprintf(__('You need to wait %s before subscribing again.', 'mailpoet'), $time_to_wait));
}
$subscriber = $this->subscriber_actions->subscribe($data, $segment_ids);