Ok so I want to customize the email alerts that are sent out when a document is modified so that besides the information that is already there, it also shows the comment that the editor typed in when they checked-in the document.

For example lets say User A uploads a document to a Library and he 'Alert Me' of changes. Now lets say User B goe ahead and modifies the document, and saves it back to SharePoint. Since we have Versioning and Check-In/Out enabled, when User B saves the document he will be asked to publish it and to enter some comments. Lets say he entered the comments and clicks to finish the process. Now User A will receive an alert email that the document was edited by User A but it does not say the comment, so the User A has no idea what the change could be. How can I edit the alert email so it would show this comment filed?

I got as far as going to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML and opening the alerttemplates.xml but I am not too sure where to add the comment field or what the comment field is called...any tips?

Thank You!

EDIT: I'm going to guess the changes would have to be under here?

<AlertTemplate Type="List"  Name="SPAlertTemplateType.DocumentLibrary">  
  <EventTypes IsVisible="True"/>  

But now I don't really understand this code or how I could add that comments field into the email. I will keep looking , any ideas?

2 Answers 2


I had to do this last year for a client and it took about eight solid weeks to get it to work right. I cannot advise against this strongly enough. Here is just a smattering of some of the issues you will have to contend with :

  • Checkin Comments are not stored in the delta for the item change, so you must match them manually based on timestamps.
  • The above point means that you must write your own alerthandler in order to process the alerts
  • This also means that in order to inject the comments into the alert, you must either parse apart the alert html or building it from scratch
  • if you parse apart the html, be advised that there is nothing in there that points to an ID. You must process the link for each item and try to find the document based on the Url. Oh, and be prepared to handle the URL changes that Office Web Apps introduces as well
  • It is quite possible that the underlying file can have been deleted between the time of the change and the time the alert fires, in which case, no details are available
  • It is even more likely that there will be multiple changes to a file (and thus multiple checkin comments) so you will have to use code to attempt to match up a specific change with the entry for it in the Versions collection.
  • Timestamps (in our environment) can be off as much as 3 seconds between the change time in the alert delta and the timestamp on the version itself, which means that you have to allow for a 'best guess' at the change.
  • immediate alerts aren't so bad as there is only a max of 5 minutes between the time of the change and the time the alert fires. Digest alerts (daily/weekly) can contain dozens of changes for the same document.
  • The blog posting that I've been working on to try to explain this topic is now up to 17 pages so I could really keep going for quite a while.

If the client is willing to pay for it, so be it, but expect some pain. Before you sit down to estimate it, here's a few links to look over so you can better understand the mechanics of the beast.

The task gets a bit easier if the client can do without the comments appearing on Digest alerts but not a whole lot.

  • Thanks! I'm going to have a read through those now. Well I am not getting paid for it :( I'm an internal employee and they asked me if this is possible. Basically they just want to see something that says what was edited in the email, doesn't need to be the Check-In comments, thats just the only thing I could think of. Is there something that would be easier? Because this sounds pretty finichy. :) thanks for the reply
    – Tudor
    Commented Aug 24, 2012 at 21:37
  • After looking into this more and reading what Dave posted, we are putting this off for a while as it is way too much coding for such a small result and the time can be better used elsewhere.
    – Tudor
    Commented Sep 13, 2012 at 21:46

Hi you are in the right place it looks like.

Here is the msdn link for the schema, http://msdn.microsoft.com/en-us/library/ff408182.aspx

You need to look at the fields section.

They will look like this:

<GetVar Name=”Value#{Field}” />

Good luck, shout back if you need more specifics.

  • Unfortunately, I tried every variant of that in the first outing and CheckInComments simply would not appear. If someone can get that to work for the CheckInComments, especially in the Digest, I would be thrilled beyond words. (yeah, I really am that much of a SharePoint geek)
    – Dave Wise
    Commented Aug 24, 2012 at 21:40
  • Darn, I thought it would be that easy :( I have no experience with Alerts but I guess we will get acquainted if I go though with this. Any thing you guys recommend othe than Check-In Comments to be sent in the email that would describe the document changes?
    – Tudor
    Commented Aug 24, 2012 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.