Try our conversational search powered by Generative AI!

My Custom Notification Provider Will Not Execute


I have a custom INotificationProvider. It never triggers when a notification is sent.

I have the class implemented at the most basic level I can:

    public class MyNotificationProvider : INotificationProvider
        public string ProviderName { get { return "MyProvider"; } }

        public NotificationFormat GetProviderFormat() { return new NotificationFormat { MaxLength = null, SupportsHtml = true }; }

        public Task SendAsync(IEnumerable messages, Action succeededAction, Action failedAction)
            // Do stuff

When an action occurs that should throw a notification, I can hit a breakpoint multiple times for ProviderName, so I know the system is aware that my provider exists. These calls are coming in from EPiServer.Notification.Internal.NotificationUserRepositoryImpl.GetUserPreferencesFromProviders.

However, SendAsync never executes.

I suspect it has something to do with the ChannelName and TypeName on the NotificationMessage, but I can't find any documentation to tell me what those should be. There doesn't seem to be a "mapping" between types/channels and specific providers.

How does a provider declare what channels or types it wants to handle? Also, since my provider seems to be called from a method called "GetUserPreferencesFromProviders," I'm wondering where these "user preferences" are and how they should be set.

Sep 18, 2017 21:30

Hey Deane,

It's probably similar to INotificationFormatter that is registered inside internal classes. I haven't tried this myself, but remembered this discussion, it might be helpful:



Oct 02, 2017 15:30


Im interested in this aswell. 

I have my custom provider ( post to slack) and whenever any notification happens, I want it into a slack channel. Somehow we cannot add/hook into the built in user notification provider.

About the subscription. seems we need to handle that ourselves too. Would be nice if episerver extended "my settings" and added subscription handling there.

Any lights on this would be appreciated. 


Nov 06, 2017 17:14

Hi Deane,

I demoed this last year, so the API might have changed slightly, but what I suspect is missing is a Formatter for a custom channel name. Then binding your Provider to the same channel name, and supplying a conversion between a username and what the provider wants as recipients (e.g. an email adress). How to write a formatter is in the documentation, but we'll update with an example on registering a provider for a channel name. In the meantime, here's an example:

            // Get preference register
            var preferencesRegister = context.Locate.Advanced

            // Register a provider to handle your custom channel
                username => GetEmailExampleMethod(username));

Here is the demo code on Github. You're probably most interested in IftttNotificationProvider.csNotificationFormatter.cs, and NotificationInitialize.cs.

Nov 08, 2017 14:33


Instead of "my-custom-channel-name", can we jack into episerver's default channel name? Whenever a new NotificationMessage() is created without specified channelName, it will pop up in edit mode. I want that message to, so I get all episerver messages to my provider.



Nov 08, 2017 15:27

Hi Per,

If there's no channel name it goes, as you said, directly to the UI. So you can't use your own provider there. Episerver notifications always use a channel name, but replacing their formatter or provider isn't supported. You can probably hijack it somehow but I can't say it'd work 100%.

Nov 08, 2017 15:57

Cool thanks for input. A feature request then maybe... :-)

Nov 08, 2017 16:02
* 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.