Yes, you all know the kind of messages I mean. I was asked yesterday if there was a way to remove some data from those announcement messages that are sent out when you have enabled alerting on a announcement list. It turns out that you can change this for about any alert in MOSS/WSS
The typical announcement message looks something like this:
|
| ||||||||
| Title: | Test Item | | ||||||
| Body: | Test Body Text | | ||||||
| Expires: | 18/01/2008 | | ||||||
| Last Modified 7/01/2008 14:51 by System Account | ||||||||
Well, one of our users wanted us to remove the Title, Body and Expires Field from the mail message.
So I did a little research and found out that the place to make this change is the alerttemplates.xml file.
I was guided somewhere to the following document on the net http://www.combined-knowledge.com/Downloads/Modify_Alert_Notifications.pdf (I attached the document to this post)
Another source I used is: http://www.topxml.com/rbnews/XML/re-70019_Customizing-Alert-Notifications-and-Alert-Templates-in-Windows-SharePoint-Services-3-0.aspx
Anyway in short I ended up changing the following lines in the xml file in the <AlertTemplate Type=”List“ Name=”SPAlertTemplateType.Announcements“> section:
from:
<Properties> <ImmediateNotificationExcludedFields>ID;Author;Editor;Modified_x0020_By;Created_x0020_By;_UIVersionString;ContentType;TaskGroup;IsCurrent;Attachments;NumComments;</ImmediateNotificationExcludedFields> <DigestNotificationExcludedFields>ID;Author;Editor;Modified_x0020_By;Created_x0020_By;_UIVersionString;ContentType;TaskGroup;IsCurrent;Attachments;NumComments;</DigestNotificationExcludedFields> </Properties>
to:
<Properties>
<ImmediateNotificationExcludedFields>ID;Title;Body;Expires;Author;Editor;Modified_x0020_By;Created_x0020_By;_UIVersionString;ContentType;TaskGroup;IsCurrent;Attachments;NumComments;</ImmediateNotificationExcludedFields> <DigestNotificationExcludedFields>ID;Title;Body;Expires;Author;Editor;Modified_x0020_By;Created_x0020_By;_UIVersionString;ContentType;TaskGroup;IsCurrent;Attachments;NumComments;</DigestNotificationExcludedFields>
</Properties>
this tells SharePoint to longer show the fields Title, Body and Expires in the alert
Once edited and saved, you need to enable this as follows:
copy the modifed xml into the C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\xml of every FrontEnd server in your farm
execute command stsadm -o updatealerttemplates -filename <your modified xml file> -url <your site>
execute iisreset on every Frontend
restart the Windows Sharepoint Services Timer service
Of course, if you are looking for changing some other type of alert besides Announcements, you need to make the necessary changes in the corresponding section of the xml file. The available sections are:
Alert Template Name | Description |
SPAlertTemplateType.GenericList | The first alert template in Alerttemplates.xml. GenericList is used unless there is a match to one of other event types. |
SPAlertTemplateType.DocumentLibrary | Notification of changes in document libraries |
SPAlertTemplateType.Survey | Notification of changes in surveys |
SPAlertTemplateType.Links | Notification of changes in links |
SPAlertTemplateType.Announcements | Notification of changes in announcements |
SPAlertTemplateType.Contacts | Notification of changes in contacts |
SPAlertTemplateType.Events | Notification of changes in events |
SPAlertTemplateType.Tasks | Notification of changes in tasks |
SPAlertTemplateType.DiscussionBoard | Notification of changes in discussion boards |
SPAlertTemplateType.PictureLibrary | Notification of changes in picture libraries |
SPAlertTemplateType.XMLForm | Notification of changes in XML form |
SPAlertTemplateType.DataConnectionLibrary | Notification of changes in data connection libraries |
SPAlertTemplateType.AssignedtoNotification | Assigned to task / issue list notifications |
I am trying to show the item id, I test with ItemId, ID, Itemid, itemid..
I remove id from
May be you have any idea?
tks in advance.
Hi,
removing the ID from the exception list is indeed the first step. The next step woull be to change the content section of the message to show the ID. I have tried to do so, but did not succeed.
best regards
Hi…
What I couldn’t find out here is how I would be able to change the content of SPAlertTemplateType.AssignedtoNotification
I think I should be able to change the content somehow somewhere in the database for this… but honestly I still can’t find out yet. I want to change some wording of the template. Any idea? If you know how you can email to me at leolu@live.com.sg . Thanks in advance. =)
Hi Leo,
I searched a little bit around for you and found a case where 10 steps are described that may help you
1. make alerttemplates.xml a copy to the backup folder. Open the file in notepad.
2. Find the alert template you would like to modify, following OOB alert templates
are provided:
SPAlertTemplateType.GenericList : Template for alerts on Generic lists
SPAlertTemplateType.DocumentLibrary : for Document libraries
SPAlertTemplateType.Survey
SPAlertTemplateType.Links
SPAlertTemplateType.Announcements
SPAlertTemplateType.Contacts
SPAlertTemplateType.Events
SPAlertTemplateType.Tasks
SPAlertTemplateType.DiscussionBoard
SPAlertTemplateType.PictureLibrary
SPAlertTemplateType.XMLForm
SPAlertTemplateType.DataConnectionLibrary
SPAlertTemplateType.AssignedtoNotification : Assigned to Task/Issuelist
notifications
So in your case, Leo, find SPAlertTemplateType.AssignedtoNotification
3. For example. When using the SPAlertTemplateType.AssignedtoNotification, find the first occurrence of Immediate.
We will modify the immediate alert template.
4. To remove the button “Modify my alert settings”, you may remove the following
code:
5. To remove the button, view list URL, you may remove the following code:
6. To remove the button, Mobile view, remove the below code:
7. Save the alerttemplates.xml file.
8. At the command line, type the following command:
> cd %commonprogramfiles%\microsoft shared\web server extensions\12\bin
> stsadm -o updatealerttemplates -url
that you would like to make alert changed.
9. Restart IIS admin Services and SharePoint Timer Services.
10. Check again if the customization meet your requirement.
i need to hide certain info by changing alerttemplate for a SP 2007 BLOG site alert notification
i am not sure which one to change, is it Generic list or Document library or any thing else?
how to find out which template the blog site is using, is there a way to find out?
thanks
Hi,
It depends on what type of list or library the alert is set on. If it is used to alert you regaring posts or comments on the Blog, then it should probably be SPAlertTemplateType.GenericList. All data in the Blog site template is stored in Lists, with the exception of the Photos, which are stored in a PictureLibrary (SPAlertTemplateType.PictureLibrary )
best regards,
Dirk
Hello,
I created a custom workflow using visual studio. I have it set to send an email notification when a new task is created. This is working fine. I attached the workflow to a document library in which users will fill out an browser enabled infopath form. when the notification email is sent, it has a link to the item. when that link is selected, it is opening the file in the client application. What I have to do is to add &DefaultItemOpen=1 to the end of the url.
Do you know which template I have to modify?
I am guessing that I will have to modify the AssignedToNotification. Could you please verify this.
Thanks
Hi Carl,
my guess would be thet you will need to change the url in the SPAlertTemplateType.AssignedtoNotification
. But I will check later for this.
section. I cannot verify at this tim, because I am restaging my SharePoint farm at the moment and it will take a while to get it back online
best regards
Dirk
Hi all,
I want to change the complete content of the EmailBody which is coming from SPAlertTemplateType.AssignedtoNotification.
0×010801
I able to edit the Subject of the notification but not EmailBody.
I found the code
in the XML page under Header section.
After seeing this code I thought that EmailBody Is creating somewhere else but not in the XML page.
Can someone please help me in getting the complete control over the content in the EmailBody.
And tell me how to create the URL link for the Workflow task and the NewItem was caused to raise this alert?
Hi all,
I want to change the complete content of the EmailBody which is coming from SPAlertTemplateType.AssignedtoNotification.
0×010801
I able to edit the Subject of the notification but not EmailBody.
I found the code
in the XML page under Header section.
After seeing this code I thought that EmailBody Is creating somewhere else but not in the XML page.
Can someone please help me in getting the complete control over the content in the EmailBody.
And tell me how to create the URL link for the Workflow task and the NewItem was caused to raise this alert?
Hopefull someone can answer?
My problem is: Secure site workflow-generated email; when a task is overdue, it has the correct URL link listed: ”1. Review <task name>” with a URL of: <xxxxxxxx.com/…/Document Library/FY09/09 Document/090227.pdf> .
But, when they go to edit the task, the URL starts incorrectly (an “HTTP” instead of an “HTTPS”). As an example: ”3. To Edit this task
<xxxxxxxx.com/…/Document Library/FY09/09 Document/090227.pdf>/_layouts/WrkTaskIP.aspx?ID=310&List=dbd43e53-14c2-48f5-85d1-89c123c5a3d6>
to mark the task as completed.”
I can’t find the area of the alert that refers to the HTTP URL so I can put the correct “HTTPS” URL in instead!
Dawn
Hi There, brilliant blog, I wonder if this solution can be applied to notifications sent when a workflow is executed? My SharePoint Designer workflow sends an automatic email to a groups of users telling them a task has been assigned to them. My client doesn’t like the word ‘assigned’ and would liek it changed to ‘created’. Is this possible? Thanks in advance!
Great post!
Just wondering if you know whether ‘NumComments’ is the field ‘Check In Comment’ in a Document Library – as this is what I want to expose in the Alert.
If not, is there a full properties listing available somewhere?
Cheers
Hello, I’m trying to get the .ExtendedProperties["Comments"] displayed on the alert email by altering the alerttemplatenotifications.xml. Any ideas how I should do it?
Thanks.
Hi ppl,
I want to add more custom fields in e-mail message. Can anyone tell me how can i do it. I am really stuck with it.
Hi Kalyan,
I have the same requirement as you. could you solve the problem? If you have solved the problem please tell me how have you done it.
If any once can change the mail body/details please mail me. alatif@wellmed.net or latif127@yahoo.com
Can anybody help me with showing the Comments on a Document Library Template?
Hi,
I want to change the email body of SPAlertTemplateType.DocumentLibrary section. Th change I want to do is: at the bottom it is showing like last modified by “someone name”. Instead of this I want to put as last modified by anonymous. Please suggest what I have to change.
So I tested the changes and they worked okay but I have one question that’s killing me.
Basically I am re-developing a Credit Request process using a List/Content Approval.
When a new List Item is created an email notification is generated from TASK but the email loops back to the List Item itself and not the Approval/Reject record that is associated with the List Item. In fact there is no reference to the TASK page for Approval/Reject on the List Item of the notification all together.
I understand that a link cannot be generated for the Task when the List Item is created since the List Item must be registered before the Task record. So my thoughts were to add a link to the TASK page to the Alert Notification from TASK.
So basically – how do I add a link with description to the existing SPAlertTemplateType?
Thanks in advance.
Follow Me!
Categories
Archives
Meta