I using following code to change AlertTemplate for a list. But it dosen't work. When I look at the XML for the template variable it's the correct XML. But when I look att list.AlertTemplate after that I have set the template object to it, it's XML is still unchanged. What should I do for to solve it?
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(SPUtility.GetGenericSetupPath(@"TEMPLATE\XML") + "\\SubscribeOrdersAlert.xml");
try
{
SPList list = site.RootWeb.GetList("/Lists/Tillggsbestllningar");
SPAlertTemplate template = new SPAlertTemplate();
template.Xml = xmlDoc.InnerXml;
template.Name = "Tilläggsbeställningar";
list.AlertTemplate = template;
list.ParentWeb.AllowUnsafeUpdates = true;
list.Update();
}