Share via


Customize the Mail Alert Format for Work Item Changes

You can customize the content and format of e-mail notifications for changes that you or your team members make to work items by modifying their associated xsl transform files. Your team members can configure project alerts in Team Explorer for various notifications and specify whether they want HTML or plain text as the format. For example, you can generate notifications for projects, work items, and build events, and you can customize the look and feel of the notifications that are sent to the Team Foundation user.

The e-mail notification transform files are stored in the following folder on the application-tier server:

Drive:\Program Files\Microsoft Visual Studio 2010 Team Foundation Server\Application Tier\TFSJobAgent\Transforms

You can use an XML editor, such as Visual Studio, to change any of the transform files. The following list is the two transform files for the work item event:

WorkItemChangedEvent.xsl

Formatting for HTML e-mail

WorkItemChangedEvent.plaintextXsl

Formatting for plaintext e-mail

The event service uses the .xsl and the plaintextXsl files to transform the XML data for an event into an e-mail message. Edit the .xsl file to get a different format for the e-mail notification. For HTML-formatted e-mail messages, the core layout for all events is stored in TeamFoundation.xsl. You should make a backup copy of any files that you want to change, and then test your changes. After you have made your changes, Team Foundation Server will use the modified transform the next time it generates a notification for an event. 

Note

The content of the e-mails that are issued is automatically generated from the TeamFoundation.xsl file and the above WorkItemChangedEvent xsl files. Modifying the TeamFoundation.xsl file is not recommended. If you do modify the contents of this file, you must thoroughly test your modifications. Incorrect modifications of this file can result in the failure of Team Foundation e-mail alerts and cause you to be unable to view Team Foundation work items, changesets, or files in a Web browser.

Required Permissions

To perform these procedures, you must be a member of the Administrators security group on the Team Foundation application-tier server.

To edit the e-mail template for sending e-mail notifications for work item changes

  1. On your application-tier server, open this folder:

    Drive:\Program Files\Microsoft Visual Studio 2010 Team Foundation Server\Application Tier\TFSJobAgent\Transforms

  2. Open WorkItemChangedEvent.xsl in Notepad or some other text editor.

    Note

    Even if you are logged on with administrative permissions, you must open Notepad or some other editor as an administrator to perform this function on a server that is running Windows Server 2008. To open Notepad as an administrator, click Start, right-click Command Prompt, and click Run as administrator. For more information, see the Microsoft Web site: User Account Control.

  3. Edit the file to show the message that you want in the notification e-mail.

    Note

    You should make similar changes to the WorkItemChangedEvent.plaintextXsl for any users who have requested plaintext messages.

  4. Save the WorkItemChangedEvent.xsl file.

See Also

Tasks

Configure Email Notifications and Specify the SMTP Server

Other Resources

Configuring Resources to Support Team Projects