Im trying to create CustomEventHandler
i followed the instructuion on
http://devnet.kentico.com/docs/devguide/index.html?event_handling_overview.htmbut nothing happent when i add code to my customhandler class
public override void OnAfterInsert(object treeNodeObj, int parentNodeId, object tree)
{
// INSERT YOUR CUSTOM AFTER-INSERT CODE
//ensure parent month
// type the document as TreeNode
TreeNode newsDoc = (TreeNode)treeNodeObj;
// handle the event only for news items
if (newsDoc.NodeClassName.ToLower() == "cms.news")
{
// get content of the inserted news item and send it by e-mail
EmailMessage email = new EmailMessage();
email.From = "maggie.nu@gmail.com";
email.Recipients = "admin@gmail.com";
email.Subject = "test";
email.Body = "test";
EmailSender.SendEmail(email);
}
}
what am i doing wrong