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/
46 class SiteEmailSummaryHandler extends QueueHandler
50 * Return transport keyword which identifies items this queue handler
51 * services; must be defined for all subclasses.
53 * Must be 8 characters or less to fit in the queue_item database.
54 * ex "email", "jabber", "sms", "irc", ...
67 * @param mixed $object
68 * @return boolean true on success, false on failure
71 function handle($object)
73 $qm = QueueManager::get();
76 // Enqueue a summary for all users
81 while ($user->fetch()) {
83 $qm->enqueue($user->id, 'usersum');
84 } catch (Exception $e) {
85 common_log(LOG_WARNING, $e->getMessage());
89 } catch (Exception $e) {
90 common_log(LOG_WARNING, $e->getMessage());