Tweaks: Notifications with Ploneboard
This would go in a Plone howto if we had one, however for now this is probably the best place for it. Ploneboard is great, however there is no email notification built in and as a result knowing when things get updated is a little hit and miss. Yes, you can use the RSS feeds, but not everyone uses RSS ...
The desired effect can be achieved by adding "CMFNotifications", however this is a little open-ended and the documentation does leave a little to be desired.
So, here's what you do;
- Add CMF Notifications to your instance and restart
- Visit the CMF Notification option within the Plone control panel
(this will drop you into the ZMI) - For Item creation, Item modification, Workflow transition and discussion item;
- in the "Users" box, enter "* :: python []"
- which means that under all conditions, return an empty list of users names, to which the system will append a list which is the list of people who have subscribed to the item. As another example, you might use "* :: python ['Administrator']" to cc in the system administrator on all changes.
Do NOT use the "* :: *" as listed in the documentation or you will email everyone registered on the site every time something changes. [sorry guys! ;) ] - in the "Rules" box use one of the following;
[ hopefully it's obvious which one goes in which box ] - * :: string:creation_mail_notification
- * :: string:modification_mail_notification
- * :: string:workflow_mail_notification
This will handle "most" of what you want for CMF notifications, for example subscribing to folders and documents, needless to say however it's not going to be quite that easy. Next you need to paste the following into the "patches.py" file in the CMFNotifications Products folder:
--- snip ---
def addReply(self, title, text, creator=None, files=None):
obj = self._orig_cmfnotification_addReply(title, text, creator=None, files=None)
LOG.info('Called PloneBoard addReply')
ntool = getToolByName(self, ID, None)
if ntool is not None:
ntool.onItemCreation(obj)
return obj
from Products.Ploneboard.content.PloneboardComment import PloneboardComment
PloneboardComment._orig_cmfnotification_addReply = PloneboardComment.addReply
PloneboardComment.addReply = addReply
LOG.info('Monkey-patched PloneBoard addReply')
def addConversation(self, title, text=None, creator=None, files=None):
obj = self._orig_cmfnotification_addConversation(title, text, creator, files)
LOG.info('Called PloneBoard addConversation')
ntool = getToolByName(self, ID, None)
if ntool is not None:
ntool.onItemCreation(obj)
return obj
from Products.Ploneboard.content.PloneboardForum import PloneboardForum
PloneboardForum._orig_cmfnotification_addConversation = PloneboardForum.addConversation
PloneboardForum.addConversation = addConversation
LOG.info('Monkey-patched PloneBoard addConversation')
--- snip ---
This is apparently called a "monkey patch".
When you restart Zope again , this will be applied and you will be notified when comments are added to conversations or when conversations are added, but warned however that you will not see anything via email if someone edits a comment.

