Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

My Custom Notification Provider Will Not Execute

$
0
0

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:

[ServiceConfiguration(typeof(INotificationProvider))]
    public class MyNotificationProvider : INotificationProvider
    {
        public string ProviderName { get { return "MyProvider"; } }
        public NotificationFormat GetProviderFormat() { return new NotificationFormat { MaxLength = null, SupportsHtml = true }; }
        public Task SendAsync(IEnumerable<ProviderNotificationMessage> messages, Action<ProviderNotificationMessage> succeededAction, Action<ProviderNotificationMessage, Exception> 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.


Viewing all articles
Browse latest Browse all 9076

Trending Articles