TeamCity
 
You are viewing the documentation for an earlier version of TeamCity.

Notifier Templates Configuration

Last modified: 20 April 2023

In this section you can find reference information on the location and syntax of notifier templates, connection with the build events, patterns used to represent important information, and examples:

Notifier Templates



Location



Notifier templates reside in the notifier configuration file:

  • Email notifier: <TeamCity data directory> /config/email-config.xml

  • Jabber: <TeamCity data directory> /config/jabber-config.xml

  • System Tray Notifier: <TeamCity data directory> /config/win32-config.xml

Syntax notes



Syntax of the notifier configuration files is described in the respective *.dtd files. Notifier configuration file contains two sections:

  • templates — notifier-specific templates with notification messages

  • events — the list of events to be notified about, with the references to the associated templates

<templates>



All templates are placed into the <templates> section, for example:

  • Email templates must have <subject/> and <body/> sub-elements.

  • Jabber templates text should be placed directly into the <template/> tag.

  • System Tray Notifier templates must have <message/> and <link/> sub elements. The <message/> element contains template of the message and the <link/> element contains a pattern for a link corresponding to the message.

<events>



Templates are attached to the notification events. For now supported events are:

  • build started (event type build_started)

  • build successful (event type build_successful)

  • build failed (event type build_failed)

  • build is failing (the first error notification, event type build_failing)

  • responsibility changes (event type responsible_changed)

If an event does not have a template attached, it is ignored, and the users will not receive notifications even if they subscribed to them.

Example of events attachment:

It is possible to attach template to a build configuration too:

In this case for the build configuration with the "Ant" id, a template with the "build_successful_ant_tpl" id will be used (if it exists). For all other build configurations default template will be used (referenced here by the "build_successful_tpl" id).

Substitution patterns



Each notification event supports its own set of substitution patterns.

"build_started" event patterns

"build_successful", "build_failed" and "build_failing" events patterns

"responsible_changed" event patterns

Examples



Email notifier configuration



Jabber notifier configuration