SharePoint 2010: How to remove "Email Headers" information from alert emails

Article ID: 2404173 - View products that this article applies to.
Expand all | Collapse all

Symptoms

You setup a SharePoint 2010 library to accept incoming emails. This operation adds a few new columns to the library such as Email Headers. However when SharePoint sends email alerts to the subscribers of the list and list item changes, the text in the email includes email headers information as well. You would like to know how to customize the alert template to remove the email headers text from it.

Cause

Resolution

Follow the below steps to resolve the issue described above. We will consider DiscussionBoard as our SharePoint 2010 library of choice to subscribe for alerts:

  1. Create a copy of the “alerttemplates.xml” file in the C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML folder and name it say “customalerttemplates.xml”.
  2. Open the “customalerttemplates.xml” file in notepad or Visual Studio and find the SharePoint library of your choice i.e. DiscussionBoard in our case.
  3. Keep scrolling through the alert template definition for this library until you find an element named: <Properties>
    This element originally has the following text:

       <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> 
  4. Modify this element to add the fields that you would like the email alert to exclude and remove the fields that you would want the email alert to include. e.g. below is the representation of the <Properties> element where we exclude the “E-Mail Headers” field and include the “ID” field in the email alert text:

       <Properties>
        <ImmediateNotificationExcludedFields>EmailHeaders;Author;Editor;Modified_x0020_By;Created_x0020_By;_UIVersionString;ContentType;TaskGroup;IsCurrent;Attachments;NumComments;</ImmediateNotificationExcludedFields>
        <DigestNotificationExcludedFields>EmailHeaders;Author;Editor;Modified_x0020_By;Created_x0020_By;_UIVersionString;ContentType;TaskGroup;IsCurrent;Attachments;NumComments;</DigestNotificationExcludedFields>
       </Properties>
  5. Save the modified “customalerttemplates.xml” file.
  6. Now we need to update our new alert templates' file to the SharePoint Database, so as to replace the default alerttemplates.xml file. We will use the below STSADM command to perform this activity:

    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN>stsadm -o updatealerttemplates -url "http://servername:18000" -filename "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\XML\customalerttemplates.xml"
  7. Perform IISRESET.

    The above steps will modify the alert template for your specific choice of library (viz. Discussion Board). Now if you trigger an email from SharePoint to be sent to the subscribed users, you will notice that the E-mail Headers field has been removed and the ID field has been added to the text of the email.

More Information

NOTE: The same steps given above can be used to exclude or include any other column value in the text of the alert email sent by SharePoint 2010. You need to know the internal names of the the columns you wish to exclude or include in the alert email text. The internal names of list columns can be found by writing simple object model code that uses the following line of code:

SPList.Fields[<field_name_in_string_format>].InternalName;

e.g. oList.Fields["Created By"].InternalName;

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Properties

Article ID: 2404173 - Last Review: October 21, 2012 - Revision: 6.0
Applies to
  • Microsoft SharePoint Server 2010
Keywords: 
KB2404173

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com