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?

Comments

opm8’s picture

Version: 4.5.x-1.x-dev » 4.6.x-1.x-dev
Category: feature » support

Hi,

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

cayennedan’s picture

Category: support » bug

Great 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.

killes@www.drop.org’s picture

please create a real patch.

sethcohn’s picture

Category: bug » feature
Status: Active » Needs work

I'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.

killes@www.drop.org’s picture

Please create a patch and I will look at it.

bdmp’s picture

I need this for 4.6 so bad. Please.

Fusion_Sushi’s picture

Agreed, great enhancement.

RobRoy’s picture

If someone would like to create a patch for 4.7 I'll check it out.

tain’s picture

*bump*

rgs’s picture

Sure could use this for 4.7

kthagen’s picture

Version: 4.6.x-1.x-dev » 4.7.x-1.x-dev
Status: Needs work » Needs review
StatusFileSize
new8.54 KB

Here 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.

kthagen’s picture

StatusFileSize
new8.49 KB

OK, 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.

kthagen’s picture

StatusFileSize
new8.31 KB

Here's the same functionality as above, but patched against HEAD. Note that at the moment, the HEAD branch is still 4.7.x.

tain’s picture

Thanks for all the hard work, kthagen!

dirkca’s picture

I 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.'

gisle’s picture

Title: Inducation of last and next notification data time to admin UI » automatic new user notify, notify now, enhanced settings

When 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:

  • New users are added to the Notify table when created.
  • Default notification settings for new users.
  • You can select what type of nodes to notify about.
  • "Notify now" is available (it is called "Flush e-mail queue" in the Admin UI).
  • Admin have an "enabled" colum overview.
  • Defaults are set when pre-existing users first visit the notify page.

This remaining feature request has not yet been implemented in the Drupal 7 version:

  • Indication of last and next notification date/time to appear in admin UI.

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.

gisle’s picture

Title: automatic new user notify, notify now, enhanced settings » Inducation of last and next notification data time to admin UI
Version: 4.7.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Active

Changing title.

gisle’s picture

Title: automatic new user notify, notify now, enhanced settings » Indication of last and next notification date/time to appear in admin UI

Changing title again.

gisle’s picture

Status: Active » Fixed

Indication 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.