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!
Following are the steps to set up email notifications in TeamCity. Step 1 − In TeamCity, go to your Project dashboard, click on Administration in the top right hand corner. You will then see the Email Notifier link in the left hand side. Click on this link to bring up the general settings for Email.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With