Browse Source

Add ability to send carbon copies to MailLogger.

Submitted by Roman Savko
PR: 57789
master
Stefan Bodewig 10 years ago
parent
commit
7bc9759319
5 changed files with 58 additions and 2 deletions
  1. +1
    -0
      CONTRIBUTORS
  2. +3
    -0
      WHATSNEW
  3. +4
    -0
      contributors.xml
  4. +20
    -0
      manual/listeners.html
  5. +30
    -2
      src/main/org/apache/tools/ant/listener/MailLogger.java

+ 1
- 0
CONTRIBUTORS View File

@@ -329,6 +329,7 @@ Rob van Oostrum
Rodrigo Schmidt
Roger Vaughn
Roman Ivashin
Roman Savko
Ronen Mashal
Russell Gold
Ryan Bennitt


+ 3
- 0
WHATSNEW View File

@@ -104,6 +104,9 @@ Other changes:
* performance improvements for <intersect>
Bugzilla Report 57588

* MailLogger can now add CC and BCC addresses.
Bugzilla Report 57789.

Changes from Ant 1.9.3 TO Ant 1.9.4
===================================



+ 4
- 0
contributors.xml View File

@@ -1329,6 +1329,10 @@
<first>Roman</first>
<last>Ivashin</last>
</name>
<name>
<first>Roman</first>
<last>Savko</last>
</name>
<name>
<first>Ronen</first>
<last>Mashal</last>


+ 20
- 0
manual/listeners.html View File

@@ -217,6 +217,26 @@ control for turning off success or failure messages individually.</p>
<td width="63%">Address(es) to send success messages to, comma-separated</td>
<td width="63%">Yes, if success mail is to be sent</td>
</tr>
<tr>
<td width="337">MailLogger.failure.cc </td>
<td width="63%">Address(es) to send failure messages to carbon copy (cc), comma-separated</td>
<td width="63%">No</td>
</tr>
<tr>
<td width="337">MailLogger.success.cc </td>
<td width="63%">Address(es) to send success messages to carbon copy (cc), comma-separated</td>
<td width="63%">No</td>
</tr>
<tr>
<td width="337">MailLogger.failure.bcc </td>
<td width="63%">Address(es) to send failure messages to blind carbon copy (bcc), comma-separated</td>
<td width="63%">No</td>
</tr>
<tr>
<td width="337">MailLogger.success.bcc </td>
<td width="63%">Address(es) to send success messages to blind carbon copy (bcc), comma-separated</td>
<td width="63%">No</td>
</tr>
<tr>
<td width="337">MailLogger.failure.subject </td>
<td width="63%">Subject of failed build</td>


+ 30
- 2
src/main/org/apache/tools/ant/listener/MailLogger.java View File

@@ -65,6 +65,14 @@ import org.apache.tools.mail.MailMessage;
* to send failure messages to</li>
* <li> MailLogger.success.to [required if success mail to be sent] - Address
* to send success messages to</li>
* <li> MailLogger.failure.cc [no default] - Address
* to send failure messages to carbon copy (cc)</li>
* <li> MailLogger.success.to [no default] - Address
* to send success messages to carbon copy (cc)</li>
* <li> MailLogger.failure.bcc [no default] - Address
* to send failure messages to blind carbon copy (bcc)</li>
* <li> MailLogger.success.bcc [no default] - Address
* to send success messages to blind carbon copy (bcc)</li>
* <li> MailLogger.failure.subject [default: "Build Failure"] - Subject of
* failed build</li>
* <li> MailLogger.success.subject [default: "Build Success"] - Subject of
@@ -151,6 +159,8 @@ public class MailLogger extends DefaultLogger {
.from(getValue(properties, "from", null))
.replytoList(getValue(properties, "replyto", ""))
.toList(getValue(properties, prefix + ".to", null))
.toCcList(getValue(properties, prefix + ".cc", ""))
.toBccList(getValue(properties, prefix + ".bcc", ""))
.mimeType(getValue(properties, "mimeType", DEFAULT_MIME_TYPE))
.charset(getValue(properties, "charset", ""))
.body(getValue(properties, prefix + ".body", ""))
@@ -236,6 +246,22 @@ public class MailLogger extends DefaultLogger {
this.toList = toList;
return this;
}
private String toCcList;
public String toCcList() {
return toCcList;
}
public Values toCcList(String toCcList) {
this.toCcList = toCcList;
return this;
}
private String toBccList;
public String toBccList() {
return toBccList;
}
public Values toBccList(String toBccList) {
this.toBccList = toBccList;
return this;
}
private String subject;
public String subject() {
return subject;
@@ -392,8 +418,10 @@ public class MailLogger extends DefaultLogger {
mailer.setReplyToList(replyToList);
Vector<EmailAddress> toList = vectorizeEmailAddresses(values.toList());
mailer.setToList(toList);
mailer.setCcList(new Vector<EmailAddress>());
mailer.setBccList(new Vector<EmailAddress>());
Vector<EmailAddress> toCcList = vectorizeEmailAddresses(values.toCcList());
mailer.setCcList(toCcList);
Vector<EmailAddress> toBccList = vectorizeEmailAddresses(values.toBccList());
mailer.setBccList(toBccList);
mailer.setFiles(new Vector<File>());
mailer.setSubject(values.subject());
mailer.setHeaders(new Vector<Header>());


Loading…
Cancel
Save