summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/manager/NotificationManager.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2013-11-26 16:26:44 -0500
committerJames Moger <james.moger@gitblit.com>2013-12-30 16:53:58 -0500
commitafaab55bf4f309382b55793db44033233dcfb64d (patch)
treefa14a1a5558647bbfac3666eccfab7286ee07ef5 /src/main/java/com/gitblit/manager/NotificationManager.java
parent81c90eed7323c31c7e1134e2fb21aa7819d55a30 (diff)
downloadgitblit-afaab55bf4f309382b55793db44033233dcfb64d.tar.gz
gitblit-afaab55bf4f309382b55793db44033233dcfb64d.zip
Support customizing the "from" display name for generated emails
Change-Id: Ibad9e2b1c12a24ad9c671a0d96aafb3365daa529
Diffstat (limited to 'src/main/java/com/gitblit/manager/NotificationManager.java')
-rw-r--r--src/main/java/com/gitblit/manager/NotificationManager.java32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/main/java/com/gitblit/manager/NotificationManager.java b/src/main/java/com/gitblit/manager/NotificationManager.java
index a226d1a0..22ae5517 100644
--- a/src/main/java/com/gitblit/manager/NotificationManager.java
+++ b/src/main/java/com/gitblit/manager/NotificationManager.java
@@ -142,7 +142,20 @@ public class NotificationManager implements INotificationManager {
*/
@Override
public void sendHtmlMail(String subject, String message, Collection<String> toAddresses) {
- this.sendHtmlMail(subject, message, toAddresses.toArray(new String[0]));
+ this.sendHtmlMail(null, subject, message, toAddresses.toArray(new String[0]));
+ }
+
+ /**
+ * Notify users by email of something.
+ *
+ * @param from
+ * @param subject
+ * @param message
+ * @param toAddresses
+ */
+ @Override
+ public void sendHtmlMail(String from, String subject, String message, Collection<String> toAddresses) {
+ this.sendHtmlMail(from, subject, message, toAddresses.toArray(new String[0]));
}
/**
@@ -154,12 +167,25 @@ public class NotificationManager implements INotificationManager {
*/
@Override
public void sendHtmlMail(String subject, String message, String... toAddresses) {
+ this.sendHtmlMail(null, message, toAddresses);
+ }
+
+ /**
+ * Notify users by email of something.
+ *
+ * @param from
+ * @param subject
+ * @param message
+ * @param toAddresses
+ */
+ @Override
+ public void sendHtmlMail(String from, String subject, String message, String... toAddresses) {
if (toAddresses == null || toAddresses.length == 0) {
- logger.debug(MessageFormat.format("Dropping message {0} because there are no recipients", subject));
+ logger.debug("Dropping message {} because there are no recipients", subject);
return;
}
try {
- Message mail = mailExecutor.createMessage(toAddresses);
+ Message mail = mailExecutor.createMessage(from, toAddresses);
if (mail != null) {
mail.setSubject(subject);