Content Notifications Module
This handly little module I built for a scenario I'm currently working on - but it has flexibility to be used for a variety of purposes.
In a nutshell, it will automatically send you an email when particular types of content are published (this includes clicking Publish when an existing item has been edited).
This can be used for:
- If you allow registered users on your website to create certain types of content themselves but you want to check and moderate any submissions. For instance, suppose you built a Web Directory - but wanted to check whenever anything was added to make sure your users weren't linking to spam websites!
Unfortunately, this module doesn't yet work for Comments; they don't trigger the OnPublish event. I tried using OnCreate instead - but there are other problems. For instance Comments do not usually have an IRoutableAspect which I was using for the Title. This will come with the next verision.
Getting the Module
It can either be downloaded and installed as usual from the Orchard Gallery page or simply search for "Content Notifications" in the Dashboard gallery.
Using the Module
In the Dashboard, go to Content > Content Types (I'm using 1.1 here, in 1.0 you can click directly on Content Types).
For this example we'll set up Comment notifications - so click "Edit" next to "Comment".
Click the second "Add" button (for Parts).
Tick "Publish Notification" - and click Save.
You'll now see a screen like the following (click the arrow next to "Publish Notification" to expand the options):

Once you've configured the part (see following section) don't forget to click "Save" - and now you're done!
Configuration Options
Users to notify
Here you can enter a space-separated list of usernames. Each of these users will be emailed when the content is published.
Also notify owner?
If this box is ticked, the owner of the content item will be notified. This is only useful for an item you've already published, but other users have permission to edit.
Also notify container owner?
This is useful for Containers - the owner of the Container item will be notified when an item is published to it. I initially set this up thinking it would be useful for Comments - unfortunately they don't use Container/Containables (neither do Blogs); but I left it there in case it's ever useful.
Planned Features
This module is pretty complete as-is, but there are some couple of ideas I've got for future releases:
- Support events other than Publish - Unpublish and Delete for instance.
- Add an extra Moderation feature. I'm actually considering renaming the module to Moderation. This optional feature would be able to prevent content from going public until it has been approved by a moderator, similarly to how Comments can currently work. This is however currently out of the scope of my immediate plans.
- Being able to populate the users list from the Comments settings.
- Adding a feature akin to "Watch this thread" - so any user could enter an email address and receive notifications when something is published. I'd particularly like this to be available on the Comments form.
Known Bugs (version 0.1, Orchard 1.0.20 - 1.1)
- There is a bug in the Orchard Routable module that means false notifications will be generated when the "slugified" URL is generated; i.e. immediately after a Title has been entered on the content item. A Javascript call is made in the background to Routable's ItemController.Slugify action and this triggers a Publish event when the content has not yet been published. I've raised a workitem for it here: http://orchard.codeplex.com/workitem/17567 and there's a detailed description here: http://orchard.codeplex.com/discussions/251316
- If you enter incorrect user names it could cause an error
- If you enter a user name as well as ticking either notify owner or notify container owner, this could result in multiple notifications being sent to the same user (if the owner is also one of the listed users)
- If the user doesn't have an email address configured (could happen with default admin user, or if you specified "notify owner" for content that guest users can create such as Comments) an error will occur in the messaging system
Finally...
I hope you find this module useful! Please let me know if you have any issues or questions.