Forum OpenACS Development: when to send out news notifications

Collapse
Posted by Hamilton Chua on
I'm currently looking at news v. 5.2.0d6

There seems to be a little problem with notifications and release dates.

I guess we want people to be notified of news items when the news item is released.

It seems that notifications are sent right after a news item is created. This is ok because we can check that the news item has not yet been released and we can prevent the notification from going out. However, when the news item is finally released there is no trigger to send out a notification for that news item.

A news items is determined as released by the release date and it seems that it is a display thing.

Any ideas on when/where we should put the do_notifications call for news items with a release date in the future ?

Collapse
Posted by Malte Sussdorff on
I think we should do the do_notifications call in the procedure that releases the news item, so yes, the notifications should be send once the item is released.
Collapse
Posted by Hamilton Chua on
Yes, but what triggers the release ? Is there a proc in news that sets the news item as released ? If there were, that would be the best place to put do_notifications.

But I don't think there is.

The "released" state is determined solely by the release_date. The release_date is queried and compared with the current date when the user visits the news page.

Collapse
Posted by Jun Yamog on
Hi Ham,

I think you will need to create a scheduled proc or something that does the notification. From what I remember and as you described, news are displayed using a query that uses release_date. I think the current implementation was simpler (reason for it just using a query) than actually changing the state of the news (as CMS package implemented it).

Collapse
Posted by Dave Bauer on
We could add a callback to the scheduled proc that releases cr_items on the publish date. This callback could be implemented for the news content type and call the notifications from there?
Collapse
Posted by Malte Sussdorff on
Exactly my thinking. Dave's suggestion should work like a charm.