diff options
author | Evan Prodromou <evan@status.net> | 2010-11-08 13:10:09 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-11-08 13:10:09 -0500 |
commit | 797059340e304a707dda5596f30651ffc727f3c3 (patch) | |
tree | 2817649c8b822a586c603c93510d5de45f2021c3 /plugins/EmailSummary/EmailSummaryPlugin.php | |
parent | 90037696093742abdc4e92171eb5188e8ad64ec0 (diff) |
Complete email summary sending system
Added the necessary classes to send email summaries. First, added a
script to run on a daily basis. Second, added a queue handler for
sending email summaries for users, and another to queue summaries for
all users on the site. Fixed up the email_summary_status table to
store the last-sent notice id, rather than a datetime (since we don't
support 'since' parameters anymore). Finally, made the plugin class
load the right modules when needed.
Diffstat (limited to 'plugins/EmailSummary/EmailSummaryPlugin.php')
-rw-r--r-- | plugins/EmailSummary/EmailSummaryPlugin.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/plugins/EmailSummary/EmailSummaryPlugin.php b/plugins/EmailSummary/EmailSummaryPlugin.php index dd72329f8..03577bb4a 100644 --- a/plugins/EmailSummary/EmailSummaryPlugin.php +++ b/plugins/EmailSummary/EmailSummaryPlugin.php @@ -63,7 +63,7 @@ class EmailSummaryPlugin extends Plugin false, 'PRI'), new ColumnDef('send_summary', 'tinyint', null, false, null, 1), - new ColumnDef('last_summary', 'datetime', null, + new ColumnDef('last_summary_id', 'integer', null, true), new ColumnDef('created', 'datetime', null, false), @@ -89,6 +89,10 @@ class EmailSummaryPlugin extends Plugin switch ($cls) { + case 'SiteEmailSummaryHandler': + case 'UserEmailSummaryHandler': + include_once $dir . '/'.strtolower($cls).'.php'; + return false; case 'Email_summary_status': include_once $dir . '/'.$cls.'.php'; return false; @@ -116,4 +120,19 @@ class EmailSummaryPlugin extends Plugin _m('Send an email summary of the inbox to users.')); return true; } + + /** + * Register our queue handlers + * + * @param QueueManager $qm Current queue manager + * + * @return boolean hook value + */ + + function onEndInitializeQueueManager($qm) + { + $qm->connect('sitesum', 'SiteEmailSummaryHandler'); + $qm->connect('usersum', 'UserEmailSummaryHandler'); + return true; + } } |