Loading...

Last updated: Nov 19 2018

Area: Episerver CMS Applies to versions: 11.13.0 and higher

Configuring email notifications for content approvals

Emails for content approval notifications can be configured to be sent immediately or periodically as a batch.

Note: You need to configure the SMTP settings for Episerver CMS to send out email notifications, see Configuring your email server.

The behavior of content approval notification emails prior to CMS 11.13.0 was to send an email immediately for each notification. This can lead to a lot of emails being sent, depending on how the content approvals are configured, which can be experienced by users as the system spamming them. As of CMS 11.13.0, the new default behavior is to send emails to all users periodically. This means that notifications will be batched into a single email which is sent at regular intervals.

As of CMS 11.13.0, there is also a new configuration option that makes it possible to configure content approval notification emails to be sent either immediately or periodically for all users.

How it is configured

Since the content approval notification emails are sent periodically by default, configuration is only needed when this is not the desired behavior. To configure emails to be sent immediately, the ApprovalNotificationOptions need to be configured accordingly. This should be done during application initialization. Configuring the dispatch interval for emails is handled in the scheduled job, see the notification dispatcher job section below.

The following is an example of how the options can be configured during application initialization. Please note that a module dependency on FrameworkInitialization is required to ensure correct execution order.

[InitializableModule]
[ModuleDependency(typeof(FrameworkInitialization))]
public class ApprovalNotificationInitialization : IConfigurableModule
{
    public void ConfigureContainer(ServiceConfigurationContext context)
    {
        context.Services.Configure<ApprovalNotificationOptions>(options => options.Immediate = true);
    }
}

Notification dispatcher job

There is a scheduled job, Notification Dispatcher, that dispatches notification emails at regular intervals. If content approval notification emails are configured to be sent periodically then the configuration of the scheduled job determines the interval for email dispatches.

The job is enabled by default and set to run every 30 minutes.


Do you have feedback on this documentation? Send an email to documentation@episerver.com. For development-related questions and discussions, refer to our Forums on https://world.episerver.com/forum/