More in this section
Blogs RSS feed

Sitefinity Workflow: Advanced Notifications for Content Approval

by User Not Found

Sitefinity’s content change notifications are a convenient way to keep designated people informed about  content changes to your website. By applying workflow to selected content items with just one check-box, you can notify authorizers of content pending approval:

Sitefinity Workflow Notify Users Picture

Notification Messages

Notifications are easy to activate and manage in Sitefinity. There is a default setting that delivers a generic change message, but this may not provide the detailed information you need:

Sitefinity Workflow Notify Group Image

The good thing is that the message can be easily changed to accommodate any custom notification scenario, so let’s see how…

Customizing Notification Messages

The possibilities for workflow customizations in Sitefinity are endless, and they offer a convenient way to implement any custom business case. In one of my previous posts, I provided an overview of the different means of workflow customization. For a recap, please click here (link here)

The notification logic is encapsulated in the NotifyGroup activity. It inherits from CodeActivity and provides a few editable properties to allow for customizing the e-mail receivers and the message itself.

Like most Sitefinity components, the NotifyGroup activity is a public class that can be inherited, and its methods can be overridden to achieve complete customization.

The Steps

Since the NotifyGroup activity has already implemented the logic for sending the message to the designated group of users, all you have to do is modify the EmailText property and pass it to the base logic for delivering the messages.

By overriding the Execute void method, we receive instant access to its CodeActivityContext parameter. The latter is part of the System.Activities namespace, which is part of the Windows Workflow Foundation, and as such, carries all relevant information        for the item passing through workflow.

Below is sample logic to demonstrate how you can detect the type of item, and from there, you can access any of its properties such as title, author, date of modification, just name it!

public class NotifyCustom : NotifyGroup
    protected override void Execute(System.Activities.CodeActivityContext context)
        //Get the item
                 var dataContext = context.DataContext;
                 var masterFluent = (AnyDraftFacade)dataContext.GetProperties()["masterFluent"].GetValue(dataContext);
                    var item = masterFluent.Get();
// Process the EmailText property and modify it with any property you would like include
this.EmailText += “……………………………………..”;
                 //This sends the message

Once you have the "item" object, you can access virtually every single of hist property and compose a message of your choice sending the tile, the summary, just name it.

The final step is to replace the NotifyGroup activity in the workflow with the one create by you. The video from the previous blog post will show you how to accomplish that (link here)


Achieving complete control of your workflow notification is a straight-forward process in Sitefinity. By customizing the notifications, teams can efficiently modify content, while maintaining necessary organizational protections.


Leave a comment
  1. gregory hernandez Jan 16, 2013
    Hi Peter,

    Does this work for version 5.1 (Build 3200) of Sitefinity? If yes, then this post comes at a really good time.

  2. Peter Jan 16, 2013

    Hi Gregory,

    You are welcome. Yes, this can be done with 5.1 and even earlier versions. However, it is worth mentioning for everyone that advanced workflows are applicable with professional and higher editions.

    Please let me know if you need more questions or just tweet me.



  3. Scott Rozman Aug 23, 2013
    Could we get an example for dynamic items? I'm working in version 6.1.
     I can get notifications from Sitefinity for my dynamic type "Instructor", but all of the notifications say a new Instructor is waiting for your approval. This is after an edit or making a rejection.
    I've tried to use BaseLifecycleFacade instead of AnyDraftFacade and it executes with no errors, but the EmailText seems to have no effect. Additionally, I don't see where EmailText would do anything... based on what I see in NotificationActivityBase, it seems to be an unused property which can be set.
    Additionally, it seem there is a "Message" in the xamlx file which can be set as well, but that does not show up anywhere and the actual template showing up in the emails is contained within SendMessage which is private, so I cannot override.
  4. Zar Ni WIn Latt Dec 15, 2014


    I am using Sitefinity 7.1.5200.

    The following gave me "object reference not set to instance of an object"

    var masterFluent = (AnyDraftFacade)dataContext.GetProperties()["masterFluent"].GetValue(dataContext);

    Please advise if I need to change anything. Thanks.

    Leave a comment