// 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 = "admin@domain.com";
email.Recipients = "admin@domain.com";
email.Subject = ValidationHelper.GetString(newsDoc.GetValue("NewsTitle"), "");
email.Body = ValidationHelper.GetString(newsDoc.GetValue("NewsSummary"), "");
EmailSender.SendEmail(email);
}
|