Email Publisher¶
Publishes results of integrations via email. This implementation supports plain-text, and Html email formats. Rules regarding who receives email are configurable.
The email publisher can be used to send email to any number of users. It is common to include one user who gets an email for every build and then also send email to every developer who checked code in for this build.
tip
People tend to prefer to use CCTray rather than email for instant notification these days.
warning
Make sure that all of the Merge Publishers, along with the Xml Log Publisher task are done before the <email> publisher, or else you won't be able to include output from the build in the email. A common mistake is to put the email task in the <tasks> section instead of the <publishers> section. If an error occurs in the <tasks> section, the remaining tasks in that section are skipped, and CC.Net goes right to the <publishers> section. So if you put the <email> tasks in the <tasks> section, you'll never get any failure messages.
Version¶
Available from version 1.0
Examples¶
1<email mailport="25" includeDetails="TRUE" mailhostUsername="smtpuser" mailhostPassword="smtppassword" useSSL="FALSE">
2 <from>buildmaster@mycompany.com</from>
3 <mailhost>smtp.mycompany.com</mailhost>
4 <users>
5 <user name="BuildGuru" group="buildmaster" address="buildguru@mycompany.com" />
6 <user name="JoeDeveloper" group="developers" address="joedeveloper@thoughtworks.com" />
7 </users>
8 <groups>
9 <group name="developers">
10 <notifications>
11 <notificationType>Failed</notificationType>
12 <notificationType>Fixed</notificationType>
13 </notifications>
14 </group>
15 <group name="buildmaster">
16 <notifications>
17 <notificationType>Always</notificationType>
18 </notifications>
19 </group>
20 </groups>
21 <converters>
22 <regexConverter find="$" replace="@TheCompany.com" />
23 </converters>
24 <modifierNotificationTypes>
25 <NotificationType>Failed</NotificationType>
26 <NotificationType>Fixed</NotificationType>
27 </modifierNotificationTypes>
28 <subjectSettings>
29 <subject buildResult="StillBroken" value="Build is still broken for {CCNetProject}" />
30 </subjectSettings>
31 <xslFiles>
32 <file>xsl\header.xsl</file>
33 <file>xsl\compile.xsl</file>
34 <file>xsl\unittests.xsl</file>
35 <file>xsl\modifications.xsl</file>
36 </xslFiles>
37 <attachments>
38 <file>C:\Data\AFile.txt</file>
39 <file>Relative.txt</file>
40 </attachments>
41</email>
Configuration Elements¶
Element | Description | Type | Required | Default | Version |
attachments | A list of files to attach to the e-mail. If the full path is not specified, then it will be relative to the project working directory. | String array | No | None | 1.5 |
converters | A set of elements containing rules for creating email adresses based on the modifiers name. The converters will be used when the name of the modifier is not set in the users section. | Email Converter array | No | None | 1.0 |
description | Description used for the visualisation of the buildstage, if left empty the process name will be shown. | String | No | The task/publisher name. | 1.5 |
dynamicValues | The dynamic values to use for the task. | Dynamic Values array | No | None | 1.5 |
groups | A set of <group> elements that identify which the notification policy for a set of users. | Email Group array | Yes | n/a | 1.3 |
users | A set of <user> elements that define who to send emails to. | Email User array | Yes | n/a | 1.0 |
environment | A set of environment variables set for commands that are executed. Each variable should be specified as
. |
Environment Variable array | No | ||
from | The e-mail address that email will be marked as coming from. | String | Yes | n/a | 1.0 |
includeDetails | Whether to send a full report or not. If not, just sends a simple status message with a link to the build report. | Boolean | No | false | 1.0 |
mailhost | The SMTP server that CruiseControl.NET will connect to to send email. | String | Yes | n/a | 1.0 |
mailhostPassword | The password to provide to the SMTP server. | PrivateString | No | None | 1.2 |
mailhostUsername | The user name to provide to the SMTP server. | String | No | None | 1.2 |
mailport | The SMTP server port number. | Int32 | No | 25 | 1.0 |
modifierNotificationTypes | A set of <NotificationType> elements, specifying build states for which CruiseControl.Net should send an email to the comitters of the build. | String array The following values are valid:* Always * Change * Failed * Success * Fixed * Exception |
No | Always | 1.0 |
replyto | The e-mail address to use for replies. | String | No | None | 1.0 |
subjectPrefix | A string that will be the first string of the subject. | String | No | None | 1.0 |
subjectSettings | A set of <subject> elements that define the subject of the email, according to the state of the build (broken, fixed, ...) | Email Subject array | No | None | 1.0 |
useSSL | Whether to use SSL or not for sending the e-mail. | Boolean | No | false | 1.0 |
xslFiles | A list of xsl files that will be used to fill up the message body, if left blank the list will be taken from ccnet.exe.config or ccservice.exe.config. | String array | No | None | 1.5 |
Notes¶
HTML E-mails¶
When includedDetails = True, the message body will contain more information. This detailed information is constructed from xsl transformations on the build log. If the xslFiles section is filled these files will be used, if not defined the xls files are defined in the ccnet.exe.config in the xslFiles section. (see also: Server Application Config File). When adjusting one of these, restart the console/service. The benefits of defining the xsl files in the email publisher:
* the xsl files are automatically the same for the console as for the service (no more keeping these 2 in sync) * it is possible to give projects different xsl transformationswarning
The groups node may be empty, but the group section must exist.
GMail¶
For sending mail via gmail :
* mailhost="smtp.gmail.com" * mailport="587" * mailhostUsername="xxx.yyy@gmail.com" * mailhostPassword="yourpassword" * useSSL="TRUE"
Automatically Generated¶
Documentation generated on Monday, 26 May 2014 at 7:18:00 AM