Quantcast
Channel: Optimizely Search & Navigation
Viewing all articles
Browse latest Browse all 6894

Programatically creating Block in folder with Approval Sequence does not generate Notifications

$
0
0

Using: EPiServer.CMS version=11.12.0 

Programatically creating a Block in sub-folder whose parent has an Approval Sequence does not generate the Notification emails, is this a bug?

This works: Manually adding Block via the CMS back-end in blocks folder with inherited Approval Sequence. I investiagted what was happening in the database and this is what occurs when the Block is created in the CMS:

  1. Create Block
    1. Creates 1 record in the [tblNotificationSubscription] table
      1. e.g. projects://notification/21234/
    2. Publish the content set it to Ready for Review
      1. Creates 2 records in the [tblNotificationSubscription] table
        1. approvals://notification/17/ (one for each User in the Approval group)
        2. projects://notification/21235/
      2. Creates 1 record in the [tblNotificationMessage] table
    3. Run the Notification Dispatcher service – sends email to relevant people in the Aproval Sequence group

 

This does not create the Notifications: Programmatically creating a Block and adding to folder with inherited Approval Sequence is as below. The problem here is that the Notification email is never generated in the [tblNotificationMessage] table:

  1. Create Block with code below sets the Block to Ready for Review
_contentRepository.Save(contentBlock, SaveAction.RequestApproval, AccessLevel.NoAccess);
  1. Creates 1 record in the [tblNotificationSubscription] table
    1. e.g. approvals://notification/19/
    2. Note: There is no projects:// entry added
  2. No records are added to the [tblNotificationMessage] table

So when I programatically add the Block that is in a Approval Sequence NO notifications are generted = no emails sent to the relevant modertators.

Is this a bug?

Is there any way to tell Episerver to create the Notifications for the Approval Sequence other than programatically using the INotifier interface?

If I have to us the INotifier interface is it possible to use the epi-approval Channel and Approval type like in code below:

var notifier = ServiceLocator.Current.GetInstance<INotifier>();
INotificationUser sender = new NotificationUser("noreply@hop-episerver.com");
INotificationUser receiver = new NotificationUser(_settingsWrapper.HopSiteSettingsPage.CommentModeratorsGroupEmail);
notifier.PostNotificationAsync(new NotificationMessage()
{
    ChannelName = "epi-approval",
    // Content =  What Json do I add here for the email formatter or how do I access the formatter txt??
    Recipients = new[] { receiver },
    Sender = sender,
    TypeName = "Approval"
});


Viewing all articles
Browse latest Browse all 6894

Trending Articles