Repeated notifications

ekrispin - July 30, 2008 - 12:13
Project:Inactive User
Version:6.x-1.0-beta2
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I would like an inactive user to be notified again and again when the specified period passes again since the last notification without the user logging in.

E.g. if the specified period is 3 weeks then currently the user is notified once after a 3 weeks period of inactivity. I would like him to be notified also after 6 weeks, 9 weeks, etc.

Looking into the code, a possible solution might be to set to 0 at a cron run the notified_user and notified_admin fiels in table inactive_user in the database for users that the specified period has elapsed.

#1

ekrispin - July 30, 2008 - 12:27

#2

deekayen - July 30, 2008 - 12:22

I don't think I understand your initial suggestion. Setting it 0 would notify the user on every cron run from the start of the notification period until they're blocked. If I were to fill this request, I'd want to do it in such a way that notification could happen on every cron run as opposed to just 3 or 5 times (imagining 4 extra notification config forms).

#3

ekrispin - July 30, 2008 - 12:51

I mean to set it to 0 when the specified period has elapsed SINCE THE LAST TIME THE USER WAS NOTIFIED (not since his/her last access).

#4

fred0 - August 20, 2009 - 05:03
Version:5.x-1.1» 6.x-1.0-beta2

In reviewing this module for my site, I too realized I needed this functionality and that it wasn't much of a change to make it work. Here are patches against 6.x-1.0-beta2 for the install and module files that:

  • Change the notified_admin and notified_user to remove the 'tiny' flag to accommodate a timestamp, including an update function for the change for users with beta2 already installed.
  • Add input fields to the inactive_user_notification fieldset that allow you to specify the number of days between each notification.
  • Alter the inactive_user_cron function to add logic to set the last notification timestamp and prevent sending new notifications until after the reminder period elapses.

My preliminary testing shows it to work, but I'd love to get feedback from others. Since I haven't fully tested it, I would NOT recommend trying this patch on a live site.

I've also updated the Version for this issue to 6.x-10.beta2 since that is the version I patched against and since the issue was year old without update I assumed that interest in Drupal 5 updates had waned.

AttachmentSize
inactive_user.install-092009.patch 1.25 KB
inactive_user.module-092009.patch 5.74 KB

#5

fred0 - August 20, 2009 - 05:07

I should also note that this currently sends notifications infinitely until the function is disabled whereas the original module only sent 1 notification. I'm considering adding a max number of notifications to send, but haven't gotten to it yet.

#6

fred0 - August 20, 2009 - 05:11

Minor tweak to the wording on the new field descriptions.

AttachmentSize
inactive_user.module-092009-01.patch 5.75 KB
 
 

Drupal is a registered trademark of Dries Buytaert.