简体   繁体   中英

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!

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>

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM