| Project: | Notifications Add-ons |
| Version: | 6.x-2.x-dev |
| Component: | CCK notifications |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Hi,
I'm posting a sub module for the Notifications Module group for those who might be interested and for Notifications developers to look at and test.
The module enables users to send out notifications of upcoming and recent events. Time scales for both can be set in admin and users can select on/off in their account. Admin can select what event content types to include and the frequency of mailouts. The module runs on cron as well as having a manual send button. (There is currently a 'subscribe all users' button also.)
The module uses the notifications queue system, however instead of accumulating over time, all items are processed in a batch at the time of sending. It was decided to use this system because it was there and also because saving items to a database queue (rather than processing live through a php object) helps in the event of an email bottleneck which could quickly overwhelm the object.
The code has not been used extensively and should be considered alpha.
| Attachment | Size |
|---|---|
| notifications_event.zip | 6.86 KB |
Comments
#1
This will go in this other package, just for 6.x
#2
Since this is only going to be implemented in 6.x, and events has no 6.x release yet, I'm postponing this. However, I think it would make more sense for this to be a standalone module anyway, similar to Notification Locations. In fact there is already an event_notification module, so perhaps you should consider merging with that.
#3
This module has already been submitted to http://drupal.org/project/notifications_extra.
There is some confusion in nomenclature in that the notifications module system refers to system events such as insert, update, delete as events. The notifications_event module does not handle these kinds of events, it handles nodes with time based fields such as used by the event module or cck date field. This is completely different from the other event_notification module so there is no question of merging.
#4
I'm confused now - I thought the patch that the OP submitted was to add "reminder" sort of notifications for Events (as in calendar events, generated by the Events module). This functionality does not currently exist in notifications_extra AFAIK. This sounds like a good feature to have, but I don't use the events module myself so I can't help to implement it.
Are we all on the same page, or am I missing something? :)
#5
@Dane,
Yes, I think we are talking about that reminder type of notifications
@New Zeal,
You can commit the module here anytime, it doesn't matter if it's a rough development version yet. We can later move it into its own project if you want to. (Or you can create a new project right away, this 'extras' module is just to save that overhead for all these small add-ons we are working on)
#6
I confirm that you are on the right track and this module provides notifications on a regular basis of calendar events created either with the event module or with cck date fields.
The module is in good working order however its configuration may need to be expanded to meet other people's needs (eg some field names are fixed at the moment)
I have a CVS account so I can commit the module anytime especially if someone is interested.
#7
Was this written for 5.x? Seems that way... the .info file needed adjustments and db_num_rows() is used in the module and that was deprecated in Drupal 6:
http://drupal.org/node/114774#db-num-rows
As it stands, the module will white screen of death based on the db_num_rows call.
#8
rj - do you have a version that is working for D6 that we can do some testing with? Thanks
#9
I started hacking at it but didn't get too far yet. I fixed the info file so it can be enabled and removed the db_num_rows() which causes a white screen of death. Otherwise I haven't had time to look at it. I might find a bit of time this week. In the meantime if you are working on it feel free to submit any changes back to the thread.
#10
Please note that this module has been submitted here: http://drupal.org/project/notifications_extra and the version available at the top of this thread is an earlier version which is not fully functional.
#11
I'm confused - the link for notifications_extra cycles back to the same module and issue queue. When browsing the CVS repository, there is a directory for notifications_event but there is no code in it.
http://drupalcode.org/viewvc/drupal/contributions/modules/notifications_...
#12
New Zeal - can you help? If there is a more recent version of the module I'd love to know about it so I am not duplicating efforts to port it to D6. So far I have browsed the entire CVS structure and version tags and don't see any code for this (up to and including HEAD.) I also searched around the Drupal site and Google but it doesn't seem like this updated module is anywhere to be found. Thanks.
#13
My CVS login is currently telling me it doesn't work, so I have attached the module to this comment. Note that Drupal has renamed the file. It is a standard tar.gz.
#14
Ahh thank you! I was starting to look at the old module to port it over. My time is much better spent enhancing/adding to what you already did. I appreciate it!
#15
So far here is my feedback:
-- The module enabled just fine
-- All menu options for both the admin and normal users appear and can be changed accordingly
-- So far, using the messaging "simple messaging" module, I have not been successful in obtaining a notification. I'm using this module to avoid SMTP and ensure I can first get it working with a super basic notification type.
Here's what I did from the regular non-admin user perspective.
1) Went to /user/XX/edit, enabled default send method (Web), interval immediately.
2) Went to /user/XX/notifications, calendar event content types, checked the box for my content type, save. I now see a subscription, send method Web, send interval immediately.
3) Using the event module, created a new event node. Checked "Event has time", used today's date a few minutes into the future. There is no end date.
4) Waited until that time, and no message arrived. Manually ran cron, but no message is arriving.
5) As an admin user, I also went to admin/messaging/notifications/calendar_events/batch_processes and "subscribe all users" and "process event mailouts" which also did not send a message.
I'm now in the process of trying to pull the module apart and understand which functions handle timing and the actual event send process.
As of now, it looks like I am failing inside of the function notifications_event_process_events, in this code block:
$result2 = db_query("SELECT * FROM {event} as e LEFT JOIN {node} as n ON e.nid = n.nid LEFT JOIN {notifications_event} as ne ON e.nid = ne.oid WHERE '%d'<=e.event_start AND e.event_start<='%d' ORDER BY e.event_start ASC", $past, $future);Removing the WHERE makes it work for my single content type, so the SQL logic around event start/stop may be an issue. In my case $past is 1263511716 and $future is 1263511716.
#16
OK, I got it working.
$past and $future are dates stored in Unix timestamp format such as 1263511716. In the SQL statement they are being compared against a DATETIME field, which looks like this: 2010-01-15 16:35:00.
Here's what worked for me, it just changes the event_start field to a timestamp so the comparison works.
$result2 = db_query("SELECT * FROM {event} as e LEFT JOIN {node} as n ON e.nid = n.nid LEFT JOIN {notifications_event} as ne ON e.nid = ne.oid WHERE '%d'<=UNIX_TIMESTAMP(e.event_start) AND UNIX_TIMESTAMP(e.event_start)<='%d' ORDER BY e.event_start ASC", $past, $future);#17
Thanks for that Robert.
I have made those changes to the code and submitted the module to the correct location.
This module is a one off I made for a client. Their date field must have been a different format. This functionality is probably easier done using a different system but once I started with notifications I felt committed. Certainly if a site has a large number of event notifications to make, then having it part of notifications certainly helps.
#18
Thanks. FWIW, I actually think this is the 'right' way to do event notifications. There are a bunch of other modules with similar functions but notifications gives you a ton of different sending methods to use from e-mail to twitter to SMS to iPhone alerts.
I'm planning to start using this for an event reminder system internally with a group. Should be interesting, now the only problem is that the messaging framework isn't picking up on the node tokens like [title]. I want the text of the notification message to be the title and body of the event and now need to figure out where the token support is breaking down.
#19
So far the module itself works to send a notice, however token support is unfortunately not working well. Replacement tokens such as [user] are working, but most others like [title] and [yyyy] are not.
#20
I don't yet know what the issue is, but I suspect it is within the function notifications_event_process_rows(). The following line is the one that is supposed to call out to the function that fills in the tokens:
$message = notifications_event_process_digest($account, $events, $send_interval, $send_method);If I look inside of the $events variable right before it is sent, it shows this:
Array ([0] => stdClass Object (
[params] =>
[objects] => Array ( )
[upcoming] => 0
)
)
... which is basically no events. The $events variable never seems to get set as far as I can tell. These lines are interesting:
if ($queue) {$event = notifications_load_event($queue->eid);
because the $queue->eid is 0 in every case. This is probably the root cause. Here's what that object looked like for me.
stdClass Object ([sqid] => 76
[eid] => 0
[sid] => 0
[uid] => 3
[language] =>
[type] =>
[send_interval] => 0
[send_method] => mail
[sent] => 0
[created] => 0
[cron] => 1
[conditions] => 1
[module] => notifications_event
[destination] =>
)
The sqid increases with each new event notification but eid is always 0.
I have no fix, just sharing. Thoughts and suggestions are welcome.
Here's a direct link to the code, and the relevant section starts around line 555:
http://drupalcode.org/viewvc/drupal/contributions/modules/notifications_...
#21
subscribing
#22
Subscribing.
What is the status of this module?
#23
Is this module still being maintained? I am looking for something similar where I want to send notifications for events on certain dates Example list of all events today, this month I tried to enable this but it says it is incompatible with drupal 6.22.
Prerna
#24
Still interested: it looks like no out-of-the-box solution exists with Drupal to provide reminder feature.
Is the attachment in #13 the latest version? (the link in #20 leads nowhere)