3 * StatusNet - the distributed open-source microblogging tool
5 * Handler for queue items of type 'sitesum', sends email summaries
6 * to all users on the site.
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 * @author Evan Prodromou <evan@status.net>
24 * @copyright 2010 StatusNet, Inc.
25 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
26 * @link http://status.net/
29 if (!defined('STATUSNET')) {
35 * Handler for queue items of type 'sitesum', sends email summaries
36 * to all users on the site.
40 * @author Evan Prodromou <evan@status.net>
41 * @copyright 2010 StatusNet, Inc.
42 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
43 * @link http://status.net/
45 class SiteEmailSummaryHandler extends QueueHandler
48 * Return transport keyword which identifies items this queue handler
49 * services; must be defined for all subclasses.
51 * Must be 8 characters or less to fit in the queue_item database.
52 * ex "email", "jabber", "sms", "irc", ...
64 * @param mixed $object
65 * @return boolean true on success, false on failure
67 function handle($object)
69 $qm = QueueManager::get();
72 // Enqueue a summary for all users
77 while ($user->fetch()) {
79 $qm->enqueue($user->id, 'usersum');
80 } catch (Exception $e) {
81 common_log(LOG_WARNING, $e->getMessage());
85 } catch (Exception $e) {
86 common_log(LOG_WARNING, $e->getMessage());