I hope this is the right place to post this. I made some enhancements to Notify that I wanted to share with other drupal users. I developed against 4.5.x since that's what I'm running now. I haven't looked at Notify 4.6 to know how readily the changes would port.
Essentially, I want my user community to be notified of new content by default. They are not skilled enough or motivated enough to go to their user account page and turn on notification.
Also my notify interval is long (3 days), but on occassion I want to get breaking news out to them immediately. I wanted a "notify now" feature. I also wanted to know when the last notification took place and when the next notification was scheduled to take place.
Enhancements:
- Added _user hook to automatically add row to Notify table when a new user is created.
- Added configuration on admin/settings/notify page to specify initial Notify options for a new user account.
- Added configuration on admin/settings/notify page to specify which node types trigger notification, so for example, you don't have to notify your user community when new contacts are added.
- Added indication of last notification date/time and next notification date/time on admin/user/notify page.
- Added "Notify Now" button on admin/user/notify page.
- Added (removed comments from) code to add an "enabled" column (populated from the "status" field of the notify table) to the table on admin/user/notify page.
- First time you go to the admin/user/notify page, all users that are not already in the notify table will be inserted with default configuration for new users. Therefore, make sure to visit the admin/settings/notify page first to set the default configuration for new users.
See attached notify.zip which contains notify.inc and notify.module.
Please let me know if I have created any issues here or if you find bugs.
Hope this is helpful.
Jason.
P.S. Other enhancements that I may get to shortly: customization of subject and body text of the notification email such as we have for new user and password recovery email. What do you think?
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | notify-28040-cvs.patch.txt | 8.31 KB | kthagen |
| #12 | notify-28040-1.patch.txt | 8.49 KB | kthagen |
| #11 | notify-28040.patch.txt | 8.54 KB | kthagen |
| notify.zip | 5.19 KB | zympht |
Comments
Comment #1
opm8 commentedHi,
Not sure if this is a feature mismatch issue (I'm on 4.6.2), but the new Notify module (notify.zip) shows this in the log when I edit a user:
Missing argument 4 for notify_user() in /var/www/localhost/htdocs/drupal/modules/notify/notify.module on line 84.
I then got the same error from my browser when logging out of my drupal site.
The user in question already existed before I upgraded the module. I replaced the original module files with the two new ones, so maybe that has something to do with the problem.
Thanks for your help,
--opm8
Comment #2
cayennedan commentedGreat enhancement. Needs some tweaks.
cron.php is generating the following.
Fatal error: Call to undefined function: node_access_join_sql() in /www/e/ehsparentsco/htdocs/modules/notify/notify.inc on line 122
Also seeing the error: Missing argument 4 for notify_user() in .... mentioned above.
Comment #3
killes@www.drop.org commentedplease create a real patch.
Comment #4
sethcohn commentedI've attempted to make this work for 4.6
(I created a diff against 4.5, then patched against 4.6 and hand adjusted a bit)
I have to do a little clean up still in place... anyone else interested in this?
I'll post a patch once I'm happy with the changes...
So far, so good.
Comment #5
killes@www.drop.org commentedPlease create a patch and I will look at it.
Comment #6
bdmp commentedI need this for 4.6 so bad. Please.
Comment #7
Fusion_Sushi commentedAgreed, great enhancement.
Comment #8
RobRoy commentedIf someone would like to create a patch for 4.7 I'll check it out.
Comment #9
tain commented*bump*
Comment #10
rgsSure could use this for 4.7
Comment #11
kthagen commentedHere is a patch for this enhancement against 4.7.x-1.x
I have implemented everything in zympht's list of features except the "Notify Now" button, since this function is duplicated by "Save and send now".
The only change I made was to move the notification-time message (the 4th bullet point) above the table, just because I liked it better that way.
I've already rolled this out on a production server, and it's working well for me. YMMV.
Note, I'm currently extending this code to add more features, but that will be a bigger rewrite, and I'm doing it against HEAD.
Comment #12
kthagen commentedOK, minor problem with the first patch. (The code to initialize user settings the first time the admin visits admin/user/notify was in a place where it would never be executed). This patch supersedes the first one.
Comment #13
kthagen commentedHere's the same functionality as above, but patched against HEAD. Note that at the moment, the HEAD branch is still 4.7.x.
Comment #14
tain commentedThanks for all the hard work, kthagen!
Comment #15
dirkca commentedI am wondering if this feature is available with 4.7? I dont see it in my installation.
'Added _user hook to automatically add row to Notify table when a new user is created.'
Comment #16
gisleWhen I went through the issue queue this morning, I noticed this very interesting feature request from 2005 fir the Drupal 4 version of Notify.
However, version 4 is no longer supported and there is not very likely that this patch will get reviewed in 2013.
The good news is that Notify has made progress since 2005 and it turns out that all the requests posted by zympht except one has made it into the Drupal 7 version of Notify (most of them are also in versions for Drupal 5 and 6).
Here is a list of what has been delivered:
This remaining feature request has not yet been implemented in the Drupal 7 version:
I'll move this up to the latest version (7.x-1.x-dev) and look into fulfilling the last request for the next snapshot.
Comment #17
gisleChanging title.
Comment #18
gisleChanging title again.
Comment #19
gisleIndication of last and next notification date/time to appear in admin UI is a feature added to the 7.x-1.x-dev snapshot pushed today. As noted in #16, the other requests are already in place.
If anyone wants this feature request backported to older versions, they need to re-open in two weeks.