Posted on 08/10/2015 11:56:50
Hi Antonio
You can use a notification subscriber when the item is saved:
[Dynamicweb.Extensibility.Subscribe(Dynamicweb.Notifications.Items.Saving)]
public class ItemSavesSubscriber : Dynamicweb.Extensibility.NotificationSubscriber
{
public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args)
{
if (args == null)
{
return;
}
var loadedArgs = (Dynamicweb.Notifications.Items.ItemArgs)args;
Dynamicweb.EmailHandler.Send(new System.Net.Mail.MailMessage("noreply@dynamicweb.com", "someone@dynamicweb.com"));
}
}
Dynamicweb.Notifications.Items.Saving is executed before the actual persistence to DB. You can also use Dynamicweb.Notifications.Items.Saved after it has been persisted.