Modify

Opened 18 years ago

Closed 15 years ago

Last modified 11 years ago

#725 closed enhancement (fixed)

RFE: Email notification mechanism

Reported by: omry Owned by: Immanuel Scheerer
Priority: high Component: DiscussionPlugin
Severity: normal Keywords: email notification
Cc: armandocroce@…, jjbig Trac Release: 0.10

Description

it would be really nice to have notification mechanism for forum topics, similar to the notification mechanism for tickets: I would like to receive a email notification for every new forum message (not by me), and I would like users to be able to register to receive notification for messages posted on a topic.

Attachments (1)

notification.patch (11.1 KB) - added by Immanuel Scheerer 18 years ago.

Download all attachments as: .zip

Change History (36)

comment:1 Changed 18 years ago by Radek Bartoň

Status: newassigned

Should be users able to register into whole forum or simple topic? I would prefer to make configurable option if e-mail should be posted to author, because ticket system is posting to author too and this behaviour suits me.

comment:2 Changed 18 years ago by omry

I think logic like the tickets is the simplest functional approach: when a new reply is posted to a topic, email a notificaton all topic posters. (be careful not to email once for each message, this will probably cause multiple messages to sevral people). you can use either sender email (as registered in the system), or the user name, if the user entered an email there.

comment:3 Changed 18 years ago by trac@…

registered email.

comment:4 Changed 18 years ago by terekhov@…

That would be a very useful feature!

comment:5 Changed 18 years ago by sjoliver@…

Thanks for this plug-in - we already find it very useful for our workgroup, but the addition of notifications would be a huge plus - and FWIW, I think the per forum notification would be the most useful for us: allowing a user to 'subscribe' to a forum, and get an email whenever there is a new posting (a new topic, or a reply to an existing topic).

(That might usefully be coupled with a per-topic subscription as well - or even a scenario where anyone who has actively posted to a topic, but isn't already subscribed at the forum(/topic) level, gets notifications for that topic anyway...)

And also, as suggested above, I'd like the ability for the system to pull the email address out of the 'user name' field, as we have a username=email address convention for simplicity.

comment:6 Changed 18 years ago by Radek Bartoň

I'll try to implement e-mail notification behavior as close to trac ticket e-mail notification as possible with respectation of desired features. Unfortunatelly I don't have much time theese days since school year has started. You'll have to wait or find someone who wants to implement this and I'll arrange repository permission to him/her.

comment:7 Changed 18 years ago by erwin.feldhaus@…

I would salute this feature!

Erwin

comment:8 Changed 18 years ago by Immanuel Scheerer

Cc: anonymous added; email notification removed
Keywords: email notification added
Owner: changed from Radek Bartoň to Immanuel Scheerer
Status: assignednew

I implemented a simple e-mail notification mechanism. At the moment, mails are only sent to addresses listed in smtp_always_cc and smtp_always_bcc in the notification settings in trac.ini. Please try the notification.patch (this is my very first python code, so I'm glad to hear, how things can be improved).

I would suggest to add an extension point IDiscussionChangeListener to the discussion core component, and put the email notification in it's own component.

To allow the user to select, for which forums/forums groups/topics/messages he wants to receive notifications, a mechanism similar to that used in WikiNotificationPlugin would be great. Perhaps it is possible, to create a generic NotificationPlugin (to provide a common user interface for notifications), which can be used for all kind of user selected notifications (wiki, discussion, tickets ...).

Changed 18 years ago by Immanuel Scheerer

Attachment: notification.patch added

comment:9 Changed 18 years ago by Immanuel Scheerer

Status: newassigned

comment:10 in reply to:  8 Changed 18 years ago by Radek Bartoň

Replying to imme:

I implemented a simple e-mail notification mechanism. At the moment, mails are only sent to addresses listed in smtp_always_cc and smtp_always_bcc in the notification settings in trac.ini. Please try the notification.patch (this is my very first python code, so I'm glad to hear, how things can be improved).

Great work, I could look at your patch closely later because I'm pretty busy these days. I'm plannig to start working ton DiscussionPlugin again after New Year, but if you want I can apply your patch to repository now.

I would suggest to add an extension point IDiscussionChangeListener to the discussion core component, and put the email notification in it's own component.

To allow the user to select, for which forums/forums groups/topics/messages he wants to receive notifications, a mechanism similar to that used in WikiNotificationPlugin would be great. Perhaps it is possible, to create a generic NotificationPlugin (to provide a common user interface for notifications), which can be used for all kind of user selected notifications (wiki, discussion, tickets ...).

Write common notification plugin would be right way but I'm not sure if such interface isn't planned for some next Trac version. I haven't work with Trac for such long time that I don't know what is new and I even forgot a lot of Trac coding isues :-(.

comment:11 Changed 18 years ago by anonymous

Cc: armandocroce@… added; anonymous removed

no hope on having any progress on it?

please, don't let this great plug-in die.

Thank you,
armando

comment:12 Changed 18 years ago by Radek Bartoň

I asked if I should apply that patch without any changes or better implementation of it immediatelly, but there was no answer. I'd like to implement it more generally and there is promissed general notification sytem in 0.12 (perhaps). I'm trying to work on this plugin but there is a lot of other things more important, so sorry that its development stays for now.

comment:13 Changed 18 years ago by Immanuel Scheerer

If the patch works and people are waiting for a notification mechanism, you can apply the patch to the repository.

comment:14 in reply to:  8 ; Changed 18 years ago by Radek Bartoň

Replying to imme:

I implemented a simple e-mail notification mechanism. At the moment, mails are only sent to addresses listed in smtp_always_cc and smtp_always_bcc in the notification settings in trac.ini. Please try the notification.patch (this is my very first python code, so I'm glad to hear, how things can be improved).

I took a closer look on your patch and it needs some changes and extensions as you suggested. Some of them I make today and I hope that I'll do the others in next few days.

I would suggest to add an extension point IDiscussionChangeListener to the discussion core component, and put the email notification in it's own component.

To allow the user to select, for which forums/forums groups/topics/messages he wants to receive notifications, a mechanism similar to that used in WikiNotificationPlugin would be great. Perhaps it is possible, to create a generic NotificationPlugin (to provide a common user interface for notifications), which can be used for all kind of user selected notifications (wiki, discussion, tickets ...).

Unfortunatelly I can't get on WikiNotificationPlugin's homepage so I can react on that but for now, I agree. Of course that generic notification plugin would be great but as I said there is planned this in Trac itself. It should be called IChangeListener so let's be suprrised :-) For now is IMHO way to do that you suggested in your patch sufficient.

comment:15 Changed 18 years ago by Radek Bartoň

I've submitted basic implementation in changeset 1987. For now it only notifies about topic and reply creation and using smtp_always_cc and smtp_always_bcc as a recievers. Next step is to modify Web UI to support recievers specification for concrete forums, and topics. I think that notifying about topic and reply creation and modification is sufficient but if you think that you would use other notifications, please, let me know.

comment:16 Changed 18 years ago by anonymous

First of all thank you for your support.

The problem is that I use smtp_always_cc and smtp_always_bcc for other purposes. They cannot receive notifications from the Discussion plug-in.

Without modifying the Web UI, it will be nice to have notifications for all the authenticated users that partecipate in a topic getting their email address form the DB.

Thanks again,
armando

comment:17 Changed 18 years ago by Radek Bartoň

I considered this solution too but I'd like to add CC field as in tickets to each topic and forum for moderators and unauthenticated users. Off course author of topic and all contributors will be notified by default but there will option in trac.ini to disable this behaviour and send only to users in CC field.

comment:18 Changed 17 years ago by bewst

What I need, specifically, is for ordinary authenticated users (or unauthenticated users who have set their email address in Preferences to see a checkbox or other binary indicator that tells them whether they are currently monitoring the conversation and gives them the opportunity to change that setting. Nobody but administrators or moderators should see and be able to modify the whole Cc: list.

comment:19 Changed 17 years ago by Radek Bartoň

Ok, that is how is notification handled in many discussion systems. I can make it like that. Do you still want to use always_notify_owner, always_notify_reporter and always_notify_updater from trac.ini?

comment:20 Changed 17 years ago by anonymous

it will be nice that plus smtp_always_cc and smtp_always_bcc. Regards,

comment:21 Changed 17 years ago by hodin

is this helpful improvement still in development or was it put on ice? A field would be quite fine, like the CC field in normal trac tickets; simply the usernames separated by commas and available for both topics and forums.

comment:22 in reply to:  14 Changed 17 years ago by Pedro Algarvio, aka, s0undt3ch

Replying to Blackhex:

Replying to imme:

I implemented a simple e-mail notification mechanism. At the moment, mails are only sent to addresses listed in smtp_always_cc and smtp_always_bcc in the notification settings in trac.ini. Please try the notification.patch (this is my very first python code, so I'm glad to hear, how things can be improved).

I took a closer look on your patch and it needs some changes and extensions as you suggested. Some of them I make today and I hope that I'll do the others in next few days.

I would suggest to add an extension point IDiscussionChangeListener to the discussion core component, and put the email notification in it's own component.

To allow the user to select, for which forums/forums groups/topics/messages he wants to receive notifications, a mechanism similar to that used in WikiNotificationPlugin would be great. Perhaps it is possible, to create a generic NotificationPlugin (to provide a common user interface for notifications), which can be used for all kind of user selected notifications (wiki, discussion, tickets ...).

Unfortunatelly I can't get on WikiNotificationPlugin's homepage so I can react on that but for now, I agree. Of course that generic notification plugin would be great but as I said there is planned this in Trac itself. It should be called IChangeListener so let's be suprrised :-) For now is IMHO way to do that you suggested in your patch sufficient.

My WikiNotificationPlugin has been updated and the website is once more online, you probably tried to reach it on one of the times where I migrated my server.

I too miss a general notification system where one could attach our code on not have to write 80% of the notification code.

I'm also very interested on an enhanced notification mecanism. Perhaps, for now, al least all moderators of the specific forum which got a new post should be notified also? There might not be an interest of having a moderators email address in smtp_always_(b)cc, yet allow him to be notified of forum posts which he's a moderator?

Do note that duplicated email addresses are removed before sending the email address in trac's notification code, so duplication is not an issue with the above suggestion...

comment:23 Changed 16 years ago by Ingmar

Priority: normalhigh

(Pririty changed to high since an efficiant usage is impossible without a notification subsystem)

I really think this plugin is great, but it lacks badly of a notification system, thus I would like to see the priority be changed to High.

So there seem to be various requirements in the community: General notification, general forum notification, topic notification and thread notification - but I think this could be generalized:

'/*' would be a general notification '/1/*' would be a general notification in forum #1 '/1/34/*' would be a notification for topic #34 in forum #1

Given that a topic is the same object type as a message within a message type, '/1/89/*' could be a thread notification if message #89 is within topic #34. But for resolving purposes, it might be better to go all the way down the thread path, i. e. to set '/1/34/89/*' in this case. '/1/34/*' and '/1/34/89/*' could be resolved against each other, either at notification setup time or at notification deployment time, depending on the system architecture.

It might be ok to utilize an existing notification system like WikiNotificationPlugin, or better AnnouncerPlugin, since the latter supports wildcards already.

comment:24 Changed 16 years ago by Radek Bartoň

I suppose you know that there is a temporary notification support. It only lacks possibility of forum based notification and inviting currently not participating users to discussion. It also needs futher refactoring of certain parts. I hope I'll progress with it in the next few months.

I'm not sure what do you mean by the '/1/34/89/*' syntax in a notification context? Note that I'll change the URL request paths of discussion objects to '/discussion/forum/<id>' etc. to fix problem with topic move in RSS feeds.

comment:25 Changed 16 years ago by anonymous

Cc: jjbig added

comment:26 Changed 15 years ago by jon.stockdill@…

I'd love to use the temporary notification support, but do not see it documented on: http://trac-hacks.org/wiki/DiscussionPlugin

How is it implemented? Simply emailing smtp_always_cc and smtp_always_bcc? on new topics and updates?

Let me know and I am happy to update http://trac-hacks.org/wiki/DiscussionPlugin

comment:27 Changed 15 years ago by Radek Bartoň

smtp_always_cc and smtp_always_bcc trac.ini options in [notification] section and e-mail field from registered user's configuration. But I didn't tested if it is still working for a some time.

comment:28 Changed 15 years ago by jon.stockdill@…

With version 0.11

I set the smtp_always_cc and smtp_always_bcc in trac.ini and:

tracdiscussion.admin.discussionwebadmin = enabled
tracdiscussion.api.discussionapi = enabled
tracdiscussion.core.discussioncore = enabled
tracdiscussion.init.discussioninit = enabled
tracdiscussion.notification.discussionnotifyemail = enabled
tracdiscussion.search.discussionsearch = enabled
tracdiscussion.timeline.discussiontimeline = enabled
tracdiscussion.wiki.discussionwiki = enabled

but still no emails. I added some logging. It looks like the message_change_listeners are [].

                self.log.debug('***  ' + str(self.message_change_listeners));

I am happy to help fix it and investigate, but need a little background information on where to look. Any help is appreciated.

comment:29 Changed 15 years ago by Radek Bartoň

Just few quick thoughts:

  • Do you have smtp_enabled = true and other SMTP related options setted corretly in [notification] section of your trac.ini?
  • Check what shows your log with DEBUG level enbled?
  • Isn't possible that your STMP server drops your e-mails as spam (it happended to me before).

I'll check if notification is working for me right in the morning...

comment:30 Changed 15 years ago by jon.stockdill@…

smtp_enabled=true is set and I can receive notifications from tickets.

Here is the log:

2009-07-20 11:48:00,289 Trac[main] DEBUG: Dispatching <Request "POST u'/discussion/topic/2'">
2009-07-20 11:48:00,294 Trac[api] DEBUG: SELECT id, forum, topic, replyto, time, author, body FROM message WHERE id = 13
2009-07-20 11:48:00,296 Trac[api] DEBUG: SELECT id, forum, subject, time, author, body FROM topic WHERE id = 2
2009-07-20 11:48:00,297 Trac[api] DEBUG: SELECT id, forum_group, name, subject, time, moderators, description FROM forum WHERE id = 1
2009-07-20 11:48:00,299 Trac[api] DEBUG: SELECT id, name, description FROM forum_group WHERE id = 0
2009-07-20 11:48:00,302 Trac[api] DEBUG: realm: discussion-core, action: post-add, preview: False, submit: True
2009-07-20 11:48:00,302 Trac[api] DEBUG: actions: ['message-post-add']
2009-07-20 11:48:00,303 Trac[session] DEBUG: Retrieving session for ID u'jstockdi'
2009-07-20 11:48:00,307 Trac[api] DEBUG: i***  post-add
2009-07-20 11:48:00,312 Trac[api] DEBUG: INSERT INTO message (body, forum, author, replyto, topic, time) VALUES (Enter your message here..., 1, jstockdi, 13,
 2, 1248104880)
2009-07-20 11:48:00,314 Trac[api] DEBUG: SELECT id, forum, topic, replyto, time, author, body FROM message WHERE time = 1248104880
2009-07-20 11:48:00,315 Trac[api] DEBUG: ***  []
2009-07-20 11:48:00,317 Trac[chrome] DEBUG: Prepare chrome data for request

comment:31 Changed 15 years ago by anonymous

Checking the code I remembered that I have rewritten notification mechanism during refactoring using interfaces but I didn't implement any notification handler yet. Sorry for your troubles, I'm working on it right now.

comment:32 Changed 15 years ago by jon.stockdill@…

AWESOME. I know a little bit of python and am happy to help give some guidance. Let me know if you'd like a hand.

comment:33 Changed 15 years ago by anonymous

Changeset r6261 partially implements e-mail notifications and subscriptions. It needs further improvements especially in robustness. Subscription to forums is not finished, smtp_always_cc and smtp_always_bcc is not used so far.

There are two major areas where I can use your help: Testing if I didn't broke something and documentation update/improvement.

Any comments are welcomed.

comment:34 Changed 15 years ago by Radek Bartoň

Resolution: fixed
Status: assignedclosed

Changeset r6308 finishes work on this subject, any new issues should be placed in a new ticket.

comment:35 Changed 15 years ago by jon.stockdill@…

opened #5585

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Immanuel Scheerer.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.