Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Approval sequence customisations


Hi all,

We recently upgraded and converted over to the new approval sequences.

I have a few questions that have been raised by our web admins:

1. As mentioned here: There is no way for a webadmin to approve the page directly without doing the approval sequence, sometimes the changes are small and we trust our gatekeepers to approve content immediately.  If I can't get the product to do it, can I create a plugin to sit next to the publish button? 

It would be very basic, if the current user has admin access to the page, run code to publish the page. I just can't find any info on customisations in this area.

2. We use groups for approvals, we would like to see the usernames of the people who are awaiting to do the approval, sometime we need to call people so we need to know who is in the group. (Again, if I have access to create something near the publish button, I could probably extract the information for the editors.)

3. Is there a way to customise the approval emails? We would like to add branding and different wording.

Thanks for your help legends!


Nov 04, 2020 3:34

Anyone able to help?

Nov 05, 2020 21:05

Hey Paul,

I can't provide the full solution, but maybe I can get you part of the way.

For #1, you could hook into the content events for the page and programmatically force approval.

Example, as done in an initialization module:

    public class CustomApprovalsInitialization : IInitializableModule
        public void Initialize(InitializationEngine context)
            var contentEvents = ServiceLocator.Current.GetInstance<IContentEvents>();

            contentEvents.RequestedApproval += ContentEvents_RequestedApproval;

        private void ContentEvents_RequestedApproval(object sender, EPiServer.ContentEventArgs e)
            if (PrincipalInfo.HasAdminAccess)
                var approvalRepository = ServiceLocator.Current.GetInstance<IApprovalRepository>();

                var contentApproval = approvalRepository.GetAsync(e.ContentLink).Result;

                if (contentApproval != null)
                    var approvalEngine = ServiceLocator.Current.GetInstance<IApprovalEngine>();
                    approvalEngine.ForceApproveAsync(contentApproval.ID, PrincipalInfo.Current.Name, "Auto-approved by Admin.");

        public void Uninitialize(InitializationEngine context)
            //Add uninitialization logic

The only downside of this approach is you'll need to refresh the page to see the auto-approval take place.

Optionally, I think if an admin is part of every step of an approval sequence, they should be able to see the "Approve Entire Approval Sequence" link below the "Approve Content" button. This is likely the better way to go.


For #3, I dug into this a bit, and there's not a super simple way to do it. The actual email template is an embedded resource, and the call to get the template is internal. To get started, you'll need to create a custom formatter (INotificationFormatter) as explained here: From here, I would suggest digging into this more by decompiling the class "ApprovalHtmlEmailFormatter" in the EPiServer.Cms.Shell.UI.Approvals.Notifications namespace, and looking how the FormatMessagesAsync() is done.


Hope this helps!

Edited, Nov 06, 2020 17:24

Thanks so much Chris, forcing the approval worked well, it actually does refresh and displays a publish button.

Very much appreciated thanks!!

Nov 19, 2020 0:38
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.