How to change the Alert Email notification message for Announcements

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:










Test Site

Test Item has been added

































Modify my alert settings

|

View Test Item.

|

View Announcements

 
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:




  1. 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


  2. execute command stsadm -o updatealerttemplates -filename <your modified xml file> -url <your site>


  3. execute iisreset on every Frontend


  4. 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


 

20 thoughts on “How to change the Alert Email notification message for Announcements

  1. 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

  2. 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 [email protected] . Thanks in advance. =)

  3. 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:


    “>$Resources:Alerts_link_modify;

    |

    5. To remove the button, view list URL, you may remove the following code:


    “>$Resources:Alerts_link_view;

    6. To remove the button, Mobile view, remove the below code:





    |

    “>$Resources:Alerts_mobile_view;


    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 is the web application 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.

  4. 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

  5. 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

  6. 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

  7. Hi Carl,

    my guess would be thet you will need to change the url in the SPAlertTemplateType.AssignedtoNotification
    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 :). But I will check later for this.

    best regards

    Dirk

  8. Hi all,

    I want to change the complete content of the EmailBody which is coming from SPAlertTemplateType.AssignedtoNotification.
    I able to edit the Subject of the notification but not EmailBody.
    I found the code

    0x010801

    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?

  9. Hi all,

    I want to change the complete content of the EmailBody which is coming from SPAlertTemplateType.AssignedtoNotification.
    I able to edit the Subject of the notification but not EmailBody.
    I found the code

    0x010801

    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?

  10. 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

  11. 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!

  12. 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

  13. 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.

  14. 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.

  15. 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.

  16. 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.

  17. I am trying to change the announcements section of the alerts template in order to put a line through any changes in an edited announcement, I know the line to change is “text-decoration” which states either “line-through or none” but there are 4 possible choices which ones do I change?

Leave a Reply to Skyrunner Cancel reply

Your email address will not be published. Required fields are marked *