Developer forum

Forum » Development » Notification Subscriber on Order.State.Changed

Notification Subscriber on Order.State.Changed


Reply

Hi,


 


So, I created a Notification Subscriber class that subscribes to


Dynamicweb.Notifications.eCommerce.Order.State.Changed.


 


I was expecting that this event is triggered when you change order states in the backend (in Dynamicweb eCom Administration).


 


But doesn't seem so. Am I missing something here?


 


Below is the code sample:


 


using System;


using System.Collections.Generic;


using System.Text;


using System.Web;


using Dynamicweb;


using Dynamicweb.Frontend;


using Dynamicweb.Extensibility;


namespace MExtensions


{


    [Subscribe(Dynamicweb.Notifications.eCommerce.Order.State.Changed)]


    public class NotificationOrderStateChanged : NotificationSubscriber


    {


        public override void OnNotify(string notification, object[] args)


        {


 


            System.Diagnostics.Debug.WriteLine(notification);


         }


     }


}


 


I want to use this mechanism because, I want to send an e-mail to the customer when his/her order state changes. (eg. when the order is dispatched or canceled)


 


Regards,


Emil


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Emil


 


It is due to an error in implementation it does not work. The notification is never raised.


 


Just changed it so this notification will be raised after the orderstate has changed and the order has been saved with this new state.


 


This will be released with the update package.

 
Reply

Thanks Nicolai.


 


Looking forward to it.


 


-Emil

 
Reply

Hi,


 


I do not know if this was performed to a single solution, but I see it as a nice feature for eCom, so backend user could configure if the customer should be contacted upon order state changes, selecting an e-mail template for language purposes and little more.


 


Best Regards,


Nuno

 
Reply

Works like a charm in the new release, thanks !




 


 

 

You must be logged in to post in the forum