ASP.NET MVC 4 AllowAnonymous Attribute and Authorize Attribute
Send Email When Blog Post Published
I haven't heard much noise about the Rules Engine in Orchard CMS so I thought I would just simply post an image of how easy it is to create a rule in Orchard that sends an email when a blog post is published. Now, of course, you can create numerous rules, and I created an Orchard Tutorial showing you just that: Rules, Tokens, and Forms API in Orchard CMS. However, sending an email when a blog post is published is built into Orchard and all one has to do is enable the Rules, Content Rules, and Email Rules Modules and create a new rule using the events and actions available in those modules.
Send Email When Blog Post Published in Orchard CMS
Once you have enabled the various Orchard Modules, go ahead and create a simple send email on blog post rule that sends an email whenever a content type of blog post is published in your Orchard Website.

The Content Rules modules exposes the when content with types (BlogPost) is published event, and the Email Rules modules exposes the Send an e-mail action. You can customize who receives the email and the body of the email. The body of the email can use Tokens, another new feature in Orchard 1.3.
Publish Event Fired Twice in Orchard 1.3
Although created by design to help determine unique blog post slugs, there is a bug in Orchard 1.3 that causes the Publish Event to get fired twice when publishing a blog post. This will be fixed with Autoroute and Alias in Orchard 1.4, but for now you will have to deal with the publish event firing twice with each blog post ( or any published content item ). It is fired first when the slug is populated when creating a blog post, and a second time when the blog post is published. Any rules based on the publish event could be fired twice or fired once when nothing was actually published.
Orchard Rules Engine
However, the great news is that Orchard has a wonderful rules engine that allows Orchard Developers to extend the functionality of Orchard CMS by creating rules as well as developing custom events and actions in their Orchard CMS Modules. Orchard is a really nice ASP.NET MVC CMS and adding new features all the time.


