title: TeamCity feature to send customised emails on test/build failure
body: <p>I am using TestNG to run my Java/JavaScript test cases. For testing JavaScript modules, am using FuncUnit. The use-case is as follows:</p>
  
  <ol>
  <li>TeamCity runs Gradle file to build and test all modules in a project.</li>
  <li>Gradle invokes TestNG to run the test cases.</li>
  <li>TestNG runs the Java unit test case. Inside this test case am using Selenium to open the FuncUnit test case HTML page in a browser. After the FuncUnit test case run is completed, I am using Selenium to compile the test results and store it in a Java instance variable. In case of detecting any JavaScript test failure, I am failing the Java unit test case using assetTrue().</li>
  <li>Test failure causes build failure and TeamCity sends out emails to the users. </li>
  </ol>
  
  <p>There is unwanted stacktrace in the email which we don’t want to send. We are only interested in the details which is stored in the Java variable (in step 3) and we can do System.out.println() and this variable data will be sent in the mail. If there is any other elegant solution where-in we can push our custom data to email without depending on Stdout statements, we are open to that too.</p>
  
  <p>Also, I want this feature to be project specific. Our changes for one project should not affect the email templates of other projects. For your reference, I have attached herewith a sample email that was sent by TeamCity.</p>
  
  <p>Am using TeamCity 7.1</p>