| | |
| | | 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 |
| | |
| | | * @author James Moger |
| | | * |
| | | */ |
| | | @Singleton |
| | | public class NotificationManager implements INotificationManager { |
| | | |
| | | private final Logger logger = LoggerFactory.getLogger(getClass()); |
| | |
| | | |
| | | private final MailService mailService; |
| | | |
| | | @Inject |
| | | public NotificationManager(IStoredSettings settings) { |
| | | this.settings = settings; |
| | | this.mailService = new MailService(settings); |
| | |
| | | return this; |
| | | } |
| | | |
| | | @Override |
| | | public boolean isSendingMail() { |
| | | return mailService.isReady(); |
| | | } |
| | | |
| | | /** |
| | | * Notify the administrators by email. |
| | | * |