Condividi tramite


Customize the format for TFS email alerts

You can customize the format of email notifications, or alerts, that team members subscribe to. These notifications are sent when changes occur to work items, code reviews, source control files, and builds. To customize their format, you can modify their associated XSL transform files. In addition, your team members can configure project alerts in Team Web Access (TWA) for various notifications and specify whether they want HTML or plain text as the format.

Alert format transform files are stored in the following folder on the application-tier server:

Drive:\%programfiles%\Microsoft Team Foundation Server 12.0\Application Tier\TFSJobAgent\Transforms\1033

You can use an XML editor, such as Visual Studio, to change any of the transform files. The following table lists the two transform files used when email notifications are sent for work item change events:

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 email notification. For HTML-formatted email 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, TFS will use the modified transform the next time it generates a notification for an event. 

Note

The content of the emails 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 TFS email alerts and cause you to be unable to view work items, changesets, or files in a Web browser.

Requirements

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

To modify the alert format for work item changes

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

    Drive:\%programfiles%\Microsoft Team Foundation Server 12.0\Application Tier\TFSJobAgent\Transforms\1033

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

  3. Edit the file to show the message that you want in the notification email.

    Note

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

  4. Save the WorkItemChangedEvent.xsl file.

Related content

See Also

Concepts

Set alerts, get notified when changes occur

Other Resources

Configure an SMTP server to support alerts and feedback requests