Hi all,
Piloting Elgg at BCUC we through that a pugin, which will allow users to get email notifications of the recent blog posts, comments, added files to a community or personal space would be quite useful for many. (Some thoughts here: http://elgg.net/mod/forum/forum_view_thread.php?post=14)
Here is what we have so far. A plugin that displays list of all the communities and offers to subscribe to receive e-mail notifications of (posts/comments/files). This is mostly a “work in progress” but you already can try it out to receive posts with access from your subscribed community.
To get the redirection working properly you need to add the redirection for the 3 files in your .htaccess file. Something similar to this for all of them:
RewriteRule ^([A-Za-z0-9]+)\/subscription(\/)?$ mod/subscription/index.php…
(I guess there should be a way to overcome it, need to find it out yet)
Here is a screenshot of the plugin:
Here is the code to try it out: http://elgg.net/kstepanyan/files/-1/16088/subscription.
Thank you,
Karen
Keywords: email notification, subscription

Comments
Hi Karen,
This looks great! A lot of people have been asking for this functionality. Would you consider adding it to the plugin gallery?
Yes sure.
Do you want me to upload it to the files area or you mean on SVN?
Although I shared a link to the plugin in the original post. Here is a new link to the same plugin (with an installation readme file now) uploaded here and available in the plugins folder.
http://elgg.org/plugins/files/1
Best,
Karen
Thanks for contributing this plugin. . I am running the latest SVN 992 I believe and ran into some errors. I followed the read me, but didn't get what to do after step 3, "log in as administrator". I see the subscriptions link in the admin bar up top and when I go to that page i get the following error:
Warning: Invalid argument supplied for foreach() in /home/doggyblo/public_html/mod/subscription/lib.php on line 65
the list shows up mostly right except the drop down boxes are empty, not like your screenshot here. when I signed up I got a bunch of additional errors:
Error with SESSION: was_subscribed_to not in the sessionError with SESSION: subscription_type_was not in the session
Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/doggyblo/public_html/mod/subscription/modify_subscr.php on line 68
Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/doggyblo/public_html/mod/subscription/modify_subscr.php on line 59
these errors are beyond my skill, but perhaps it is conflict with the latest svn or some other plugins. I should mention that though it didn't say anything in the read me about manually adding the tables, I ran the sql successfully using phpmyadmin to add the tables to the dbase.
I should also add that I had changed my original "news" account to something else and often plugins are designed to be activated by the "news" user. . I've found that I have to manually change my original account back to "news" in order to install some plugins. . maybe that is going on here.
there is also this error at the bottom highlighted in pink:
A required parameter (subscr_type_2) was missing
It sounds like the "subscription_type" table is empty. Are you sure you ran all the SQL statements of the mysql.sql file, particularly the following?
INSERT INTO `prefix_subscription_type` ( `id` , `subscribtion_type` )
VALUES
('', 'Blog Posts/Comments/Files'),
('', 'Blog Posts/Comments'),
('', 'Blog Posts/Files'),
('', 'Blog Posts only'),
('', 'Files Only');
Karen,
Yes, that table is in tact. . . there are 3 tables, "subscription," "subscription_cron," and "subscription_type." Subscription type contains IDs 1-5 as indicated by the SQL. . .
I do not think it will be a PHP5 issue. You probably use Elgg 0.7. So, let me install and test the plugin it with the later Elgg and PHP.
Thank you for sharing your experience.
Thanks. daveinboston has the same issue posted in the "running elgg" forum.
I'm running:
elgg - v.70 svn build 992 (or something to that effect)
php: 4.4.4
mySQL: 4.1.21 standard log
I figured out what the problem was. Since I had changed my "news" user to something else, I assume that the plugin didn't install the dbase. So, I just copied the sql and ran it in phpmyadmin, but this obviously didn't susbstitute the correct "prefix" for the names of the database tables, resulting in tables that started with "prefix_subscription. .etc." I just changed the names to elggsubscription, etc. to match the other tables in my dbase and now it works.
well, i do appear to have a minor bug. . . after install, when I add new subscriptions for the first time, i get a couple of second page that shows a bunch of errors:
Error with SESSION: was_subscribed_to not in the sessionError with SESSION: subscription_type_was not in the session. . then a bunch of warnings array_key_exists, second argument should either be array or object in subscription/modify_subscr.php on line 59. . not sure what the fatal error is because it falls below the page and I had to print screen to capture the data because it goes back to the subscription page so quickly.
The error does not appear to happen if I add subscriptions while already having some subscriptions. . Only by deleting all subscriptions and then re-adding, can I replicate the error.
When clicking on "Your dashboard":
Fatal error: Call to undefined function: subscription_text_widget_display() in /home/doggyblo/public_html/mod/adash/lib.php on line 143
Thank you for posting these notes regarding the plugin.
I was working on the plugin last week to enhance the plugins functionality and at the .
These problems have to be gone:
SESSION: Problem, which was one of my debug messages.
The problem with Dashboard should not be there
utomatic creation should be there as well.
I have made a number of changes to the functionality and will upload the pluging soon.
Unfortunately, I have switched on all the error and notifications of my PHP engine and was unable to see array_key_exists() warning both on PHP5 and PHP4.
There are substantial changes in the plugin functionality. I am going to upload the code soon.
Thank you again,
Karen
It now allows users to get notifications not only with LoggedIn and Public access but also with restricted access if they are in the community. It works for files, posts and comments.
The main window shows all the communities with links to them and the option to subscribe to RSS as well.
http://elgg.net/kstepanyan/files/-1/16534/subscription_
All the best,
Karen
Hi Karen,
I got your email. I downloaded the new plugin and it seems to be working perfectly so far. The session error is no longer present. I disabled my dashboard with the folio plugin, so can't test that right now. . will take your word for it that it is fixed! Love the plugin. . Thanks for the hard work, the improvements and for sharing with the community!!!
It sounds like a good idea. At the moment, to get to the subscription area you already need to be logged in, besides that the plugin is using the registered users database to get users data and send e-mails. However, it would be possible to overcome by adding another table, which will come with the plugin which will store guest user information. Some thoughts are needed to implement the access of guest users as well.
But I liked the idea.
Hi Todd,
Glad you like it, your support is highly appreciated as well.
I am planning to add personal blogs to this plugin as well. It will allow people to subscribe to personal spaces. Besides that I am going to add some options for filtering, sorting or dynamically changing the presentation the list of communities/personal spaces.
Hi All,
The plugin that Karen posted is not found. Is there a new location for this great plugin that I haven't found yet?
Thanks,
Clint