tcPrettyEmail update for TeamCity 6.5.x

Posted on Updated on

A recent comment from Julien pointed out that tcPrettyEmail messages with Test results are not printing corerctly.

It turns out that the TestBean in the TeamCity API was removed, and I was using that to glean the test detail.  In version, I’ve worked around that by building my own bean and passing that to the template engine.

WARNING: This release is only compatible with TeamCity 6.5 and later. For Teamcity 6.0 and earlier, please use the earlier versions.


If you find a bug or have feature request, please post a comment below or on the tcPrettyEmail bugs page.

23 thoughts on “tcPrettyEmail update for TeamCity 6.5.x

    Ingo said:
    November 2, 2011 at 11:54

    Hello Wolf,

    I’m using TC Version 6.5.2 (build 17935). With the build-in e-mail notifications everything runs fine. Now I want to use your plugin “tcPrettyEmail”, the version is The plugin is installed correctly according to TC’s “Administration -> Server Configuration -> External plugins” list.

    I added the following XML-Code to main-config.xml (and modified the settings for my SMTP-server):

    The problem is, that I don’t get an E-Mail. Maybe there’s a bug in your plugin.

    By the way, does your plugin use the rules of TC for e-mail notification?


    Ingo said:
    November 2, 2011 at 11:57

    since XML-tags don’t work, here are the setting without the ‘pretty-mail’ and ‘smtp’-tags:

    host=”” port=”25″ username=”mySmtpUsername” password=”mySmtpPassword” from-address=”” from-name=”Friendly Name”

    netwolfuk responded:
    November 2, 2011 at 20:52

    Hi Ingo.
    The tcPrettyEmailer has its own rules in the “My Settings & Tools” page. If you go to “My Settings & Tools” in TeamCity you should see a section for “Pretty Email Notifier”. You need to set your notification settings in there for the tcPrettyEmailer plugin.
    You should see some logging appear in the teamcity-server.log file on your teamcity server when the plugin sends email.

    Devender said:
    December 30, 2011 at 13:07


    I’m trying to add PrettyEmail plugin to my Teamcity setup but not receiving any emails after a successful build. Already added rules to Pretty Email Notifier in My Settings. On looking server log, I found following error –

    jetbrains.buildServer.SERVER – PrettyEmailNotificator :: Could not assemble the BuildSuccessful prettyemail for bt2 See DEBUG output and/or STDOUT for Stacktrace
    org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource ’email-BuildSuccessful.vm’
    at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(
    at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(
    at org.apache.velocity.runtime.RuntimeInstance.getTemplate(
    at org.apache.velocity.runtime.RuntimeInstance.getTemplate(
    at prettyemailer.teamcity.PrettyEmailMimeMessageHelper.generateEmail(
    at prettyemailer.teamcity.PrettyEmailNotificator.doNotifications(
    at prettyemailer.teamcity.PrettyEmailNotificator.notifyBuildSuccessful(
    at jetbrains.buildServer.notification.impl.UserRulesAwareNotificationListener$NotificatorEventAdapter.buildSuccessful(
    at jetbrains.buildServer.notification.impl.UserRulesAwareNotificationListener.buildSuccessful(
    at jetbrains.buildServer.notification.NotificationProcessor$
    at jetbrains.buildServer.notification.NotificationProcessor$
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$ Source)
    at Source)

    Could you please suggest how can this error be resolved?


      netwolfuk responded:
      December 30, 2011 at 13:15

      Hi Deveneder.

      It appears your teamcity is not finding the velocity templates.
      Which TeamCity version are you running?
      Which TeamCity install type are you using (Windows, WAR FIle, Unix, etc).
      What OS are you using?

        Devender said:
        December 31, 2011 at 16:21


        I’m using TeamCity Professional 6.5.6. It’s been installed on windows server 2008. Please suggest where I can find these templates or/and which additional configuration I need to perform to make it working.

        Thanks for your response!


    netwolfuk responded:
    January 3, 2012 at 22:51

    Hi Devender.
    I have prepared a zip file containing just the templates and images.
    You can download it from here:

    Unzip that on your server. Then set the templates and/or images location in the config file as per the documentation here:

      Devender said:
      January 4, 2012 at 04:55


      Thanks for sending templates and images! I got it working yesterday before receiving your response. I had to do following steps to make it work –

      1. From the folder- \.BuildServer\plugins\.unpacked\tcPrettyEmailPlugin-\server, I extracted tcPrettyEmail- using WinRAR. Then from folder buildServerResources, got img and templates folders.

      2. Copied img and templates folders to my Teamcity folder in C:\

      3. Updated path of img and templates in main-config.xml

      4. Restarted Teamcity service.

      Then i received a very pretty email about my build status :). It’s very nice looking and provides very useful contents.

      Many thanks to you for providing this plugin and your help to make it work !!


        netwolfuk responded:
        January 6, 2012 at 11:01

        Well done. And thanks for your kind feedback.

    Devender said:
    April 16, 2012 at 11:31


    I’m using PrettyEmail in Teamcity for last few months and it’s working very well. Recently, I changed my sending email address to a gmail account and since then PrettyEmail is failing to deliver build email and logging following error –

    com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. y3sm7886621pbh.59

    at com.sun.mail.smtp.SMTPTransport.issueSendCommand(
    at com.sun.mail.smtp.SMTPTransport.mailFrom(
    at com.sun.mail.smtp.SMTPTransport.sendMessage(
    at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(
    at org.springframework.mail.javamail.JavaMailSenderImpl.send(
    at org.springframework.mail.javamail.JavaMailSenderImpl.send(
    at prettyemailer.teamcity.PrettyEmailNotificator.doNotifications(
    at prettyemailer.teamcity.PrettyEmailNotificator.notifyBuildSuccessful(
    at jetbrains.buildServer.notification.impl.UserRulesAwareNotificationListener

    I tried to add – securitymode=”STARTTLS” in email settings but not lucky to get the problem solved. Could you please suggest what changes are required to make it work using a Gmail account.



      netwolfuk responded:
      April 17, 2012 at 11:02

      Hi Devender.

      I’ve released a new version that has a new setting to enable STARTTLS support. You can download it from the tcPrettyEmail download page.

      I’ve updated the docs.

      For the username use your gmail account (without the suffix).
      The password is obviously your gmail password.
      The port is 587. The smtp server is
      Don’t forget to enable TLS with starttls-enabled=”true”.

    Oleg said:
    October 4, 2012 at 06:18


    I’v trying to run tcPrettyMail on TeamCity 7.1.1 without success 😦 Does version compatible with 7.1.1?

      netwolfuk responded:
      October 6, 2012 at 10:22

      I just tested it on 7.1.0 and 7.1.1 and it works for me. What problems are you seeing?
      Have a look for WARN messages in teamcity-server.log and catalina.out in the TeamCity logs directory.

    Oleg said:
    October 8, 2012 at 07:06

    I wonder but I see nothing specifc in logs 😦 Here is excerpt from main-config.xml:

    (just copy-pasted from working TeamCity Professional 6.5 (build 17795) with lite changes)

    User has further notification rules:
    – Build is successful
    – Tests are muted or unmuted
    – Build fails
    – Build fails to start
    – Build is probably hanging
    – The first build error occurs
    – Investigation is updated

    Regular email notifier works fine.

    To be honest I have no idea what is wrong 😦

    P.S.: How can fire email sending or send test email by hand?
    My dist is ‘TeamCity Professional 7.1.1 (build 24074)’


      Oleg said:
      October 8, 2012 at 07:08

      damn… excerpt is trimed…
      (smtp host=”hostname” port=”25″ starttls-enabled=”false”
      username=”???” password=”???” from-address=”email@hostname”
      from-name=”TeamCity” /)
      (template-path path=”/opt/jetbrains/TeamCity/webapps/ROOT/plugins/tcPrettyEmailer/templates/” /)
      (attachment-path path=”/opt/jetbrains/TeamCity/webapps/ROOT/plugins/tcPrettyEmailer/img/” /)
      (attach-images attach=”true” /)
      (max-tests-to-show value=”5″ /)
      (max-error-lines-to-show value=”50″ /)

    Mark Jaffe said:
    April 16, 2013 at 18:41

    I am running on TC 6.5.6 and see the issue still. Do I need EXACTLY the release for this fix? Can you also respond to SourceForge issue I raised:

      netwolfuk responded:
      April 16, 2013 at 21:21

      Hi Mark. Any version after should work (unless I have a regression). I was going to look at the bug report last night but didn’t have a tc6.5.6 to test on. Will download it and test. Sorry for the delay.

    pazhani1988 said:
    March 15, 2016 at 06:07


    I would like to have following feature.

    I have a TeamCity Project. That TC Project has multiple build configurations (say 10). All the build configurations are dependent (snapshot dependencies used).

    For the above configuration, I wanted to send a single email notification email. I have to send email if any of the build gets failed and all the build gets success with the summary.

    Please let me know if this is possible.

      netwolfuk responded:
      March 15, 2016 at 10:23

      tcPrettyEmail hooks into the same API calls as the standard TeamCity mailer.
      If you can do what you want in the standard mailer, then it should be possible in tcPrettyEmail.

      Can you try configuring what you want in the standard mailer and let me know whether you can get it working?

        pazhani1988 said:
        March 15, 2016 at 12:43

        The standard mailer also doesn’t have this option!!!

        netwolfuk responded:
        March 15, 2016 at 18:42

        Yes. I suspected that would be the case. Sorry, tcPrettyEmail won’t be able to either.

    Mohit said:
    October 11, 2016 at 17:47

    Hi netwolfuk,

    I have a bit different requirement and I am in doubt if this plugin will help me. Can you please suggest.

    I have to notify users about build failure on teamcity and it should only send emails to users who recently committed code, which caused build failure.


      netwolfuk responded:
      October 11, 2016 at 18:59

      This plugin send email using the rules defined in teamcity.
      Fortunately, these rules support what you want to do.
      Ask your users to go into My Settings & Tools, click “Edit” next to Pretty Email Notifier, and setup a new rule for “Builds with my changes only” and some failure condition(s).
      All of the notifier support this, not just the Pretty Emailer, but of course I would recommend that as the best 😉

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s