sogwiz
sogwiz

Reputation: 496

TeamCity - customize email notification for specific Projects

I'm using TeamCity 5.1.5

I'd like to customize the email notification template on a per project basis.

Project A : use custom email notification email template to include additional info about the build and test results

Project B,C,D : use the default email notification template

I've perused through the TeamCity documentation and looked into the /config/_notifications/email directory and can't seem to find anything that indicates email templates can be configured on a per project basis. Any help is appreciated.

gracias!

Upvotes: 14

Views: 5992

Answers (2)

Youngjae
Youngjae

Reputation: 25080

Followed by @bilai, you can use build.name = "PROJECT_NAME" && buildType.name="CONFIGURATION_NAME" or buildType.externalId = "YOUR_BUILD_CONFIGURATION_ID" for more fine-grained control.

Check out my complete templete code: https://gist.github.com/YoungjaeKim/cf35ef3cba344a2f85e9

Upvotes: 3

Bilal
Bilal

Reputation: 922

As far as I know, the template files can not be configured on a per-project basis.

However, using the FreeMarker expression syntax and properties provided by TeamCity, you can update the e-mail template to conditionally provide certain information for a given project.

For example:

<#if project.name = "Project A">
    Build Results: Passable
    Test Results: Smelly
</#if>

Upvotes: 15

Related Questions