3 * StatusNet - the distributed open-source microblogging tool
5 * Handler for reminder queue items which send reminder emails to all users
6 * we would like to complete a given process (e.g.: registration).
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 Zach Copley <zach@status.net>
24 * @copyright 2011 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')) {
34 * Handler for reminder queue items which send reminder emails to all users
35 * we would like to complete a given process (e.g.: registration)
39 * @author Zach Copley <zach@status.net>
40 * @copyright 2011 StatusNet, Inc.
41 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
42 * @link http://status.net/
44 class SiteConfirmReminderHandler extends QueueHandler
47 * Return transport keyword which identifies items this queue handler
48 * services; must be defined for all subclasses.
50 * Must be 8 characters or less to fit in the queue_item database.
51 * ex "email", "jabber", "sms", "irc", ...
63 * @param string $reminderType type of reminder to send
64 * @return boolean true on success, false on failure
66 function handle($reminderType)
68 $qm = QueueManager::get();
71 switch($reminderType) {
72 case UserConfirmRegReminderHandler::REGISTER_REMINDER:
73 $confirm = new Confirm_address();
74 $confirm->address_type = $object;
76 while ($confirm->fetch()) {
78 $qm->enqueue($confirm, 'uregrem');
79 } catch (Exception $e) {
80 common_log(LOG_WARNING, $e->getMessage());
85 case UserInviteReminderHandler::INVITE_REMINDER:
86 $invitation = new Invitation();
88 while ($invitation->fetch()) {
90 $qm->enqueue($invitation, 'uinvrem');
91 } catch (Exception $e) {
92 common_log(LOG_WARNING, $e->getMessage());
101 "Received unknown confirmation address type",
105 } catch (Exception $e) {
106 common_log(LOG_ERR, $e->getMessage());