From a502d96a860456ec5e8c96761db70f7cabb74751 Mon Sep 17 00:00:00 2001
From: Paul Martin <paul@paulsputer.com>
Date: Sat, 30 Apr 2016 04:19:14 -0400
Subject: [PATCH] Merge pull request #1073 from gitblit/1062-DocEditorUpdates

---
 src/main/java/com/gitblit/manager/NotificationManager.java |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/gitblit/manager/NotificationManager.java b/src/main/java/com/gitblit/manager/NotificationManager.java
index f1558b6..4bbc2ab 100644
--- a/src/main/java/com/gitblit/manager/NotificationManager.java
+++ b/src/main/java/com/gitblit/manager/NotificationManager.java
@@ -29,6 +29,8 @@
 import com.gitblit.Keys;
 import com.gitblit.models.Mailing;
 import com.gitblit.service.MailService;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
 
 /**
  * The notification manager dispatches notifications.  Currently, email is the
@@ -38,6 +40,7 @@
  * @author James Moger
  *
  */
+@Singleton
 public class NotificationManager implements INotificationManager {
 
 	private final Logger logger = LoggerFactory.getLogger(getClass());
@@ -48,6 +51,7 @@
 
 	private final MailService mailService;
 
+	@Inject
 	public NotificationManager(IStoredSettings settings) {
 		this.settings = settings;
 		this.mailService = new MailService(settings);
@@ -69,6 +73,11 @@
 	public NotificationManager stop() {
 		scheduledExecutor.shutdownNow();
 		return this;
+	}
+
+	@Override
+	public boolean isSendingMail() {
+		return mailService.isReady();
 	}
 
 	/**
@@ -112,6 +121,7 @@
 	@Override
 	public void sendHtmlMail(String subject, String message, Collection<String> toAddresses) {
 		Mailing mail = Mailing.newHtml();
+		mail.subject = subject;
 		mail.content = message;
 		mail.setRecipients(toAddresses);
 		send(mail);

--
Gitblit v1.9.1