Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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"/>  
  <Format>

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?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
    
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 Aug 24 '12 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 Sep 13 '12 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.

share|improve this answer
    
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 Aug 24 '12 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 Aug 24 '12 at 21:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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