You can go two routes here .. either purchasing a commercial solution from people like bamboo solutions and their Alert Plus Web Part or follow this article and discover how to make chnages yourself …
So, recentIy had a question from one of the clients, it also came along couple of other times, and seems like a reasonable request – but within SharePoint there is not nice GUI support on how to implement it ….. Alert Template Changes.
So the request that i got was simple and this part of the tutorial will explain simple changes to a template (basically manipulating existing XML) – next part will focus on more advanced changes – such as writing your own HTML (inside an alert) and making absolute changes to templates.
So here we go …
1. We need to locate the following file: c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Template\Xml\alerttemplates.xml
2. It’s not recommended by MS and nt supported to modify an existing file so they say just copy this file to another one and modify that other one.
One of the things i was asked to include was an ID of an item .. if you notice there is never an ID in an alert. Turns out this is turned off by default and in order to turn it on you need to find the section of an alert you need to modify … there are few of them here is how they look when you colapse them:
For my scenario i needed to modify the alerts that come to user when an item is “Assigned To” them. As you can tell from the picture below – you can modify various different templates for Surveys, Contacts etc.
So when you expand your existing list template .. you will see very standard template with fields like “Subject”, “Digest”, “Footer”
So if i want to modify subject i will modify section under “<Subject> … </Subject>”
In my case i wanted to display an ID inside a subject and inside a body so I used the following inside the subject
<GetVar Name=”ItemID” URLEncodeAsURL=”TRUE” />
This is CAML way of getting to certainvariables.
Also, if you search for “ImmediateNotificationExcludedFields” under the template you’re interested in .. you will be able to see that ID is one of the fields that is excluded and if you remove it from the list – it will e included in the body of your alerts.
Last few steps required after you make your modifications are the following:
stsadm -o updatealerttemplates -filename “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\XML\customalerttemplates.xml” -url your_sharepoint_site url
stsadm -o setproperty -pn job-immediate-alerts -pv “every 1 minutes”
- Creating SharePoint related list views (edit and display) with no code
- SharePoint Silly Questions: filtering list view with query string parameters
- How to: automatically package your SharePoint 2013 branding solutions with design manager
- SharePoint 2010 Branding: defining new Content Query roll up rendering template
- Working with SharePoint 2010 Document Sets Programatically