Start a new topic

Selecting which notifications to use

Hi


Is there a way to control which notifications the site sends?

For example I do not want to send the "Order paid notification".

1 Comment

At the current moment we do not have special UI or settings to manage which notification available or not within selected store.

We received your feature request and implement in next platform releases You may track feature implementation progress  in this issue https://github.com/VirtoCommerce/vc-platform/issues/467


I would suggest two workarounds how to implement notifications filtration depending of store:

First is global notification manager override.


Add special settings to store


your-module.manifest

 

<setting>
                <name>Stores.EnabledNotifications</name>
                <valueType>string</valueType>              
</setting>

 your-module.cs  

 //Add order numbers formats settings  to store module allows to use individual number formats in each store
            var settingManager = _container.Resolve<ISettingsManager>();
            var settings = settingManager.GetModuleSettings("Your-module-id").Where(x=> x.Name.EndsWith("Stores.EnabledNotifications")).ToArray();
            settingManager.RegisterModuleSettings("VirtoCommerce.Store", settings);

  And then need to write your implementation of INotificationManager interface which should encapsulate or derived from original implementation, where need  in next methods : ScheduleSendNotification and SendNotification implement logic for checking your new store setting Stores.EnabledNotifications.



Second  is override OrderNotificationObserver with your custom type, where implement logic of depending of store notification filtration and replace it in unity container.

 

 _container.RegisterType<IObserver<OrderChangeEvent>, YourCustomOrderNotificationObserver>("OrderNotificationObserver");

 


Login or Signup to post a comment