Class NotificationEmail
- java.lang.Object
-
- com.google.gerrit.server.mail.send.OutgoingEmail
-
- com.google.gerrit.server.mail.send.NotificationEmail
-
- Direct Known Subclasses:
ChangeEmail
public abstract class NotificationEmail extends OutgoingEmail
Common class for notifications that are related to a project and branch
-
-
Field Summary
Fields Modifier and Type Field Description protected BranchNameKeybranch-
Fields inherited from class com.google.gerrit.server.mail.send.OutgoingEmail
args, footers, fromId, messageClass, notify, soyContext, soyContextEmailData
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNotificationEmail(EmailArguments args, String messageClass, BranchNameKey branch)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidadd(RecipientType type, com.google.gerrit.server.mail.send.ProjectWatch.Watchers.List list)Add users or email addresses to the TO, CC, or BCC list.protected static StringgetInstanceAndProjectName(String instanceName, String projectName)protected static StringgetShortProjectName(String projectName)StringgetSshHost()protected abstract ProjectWatch.WatchersgetWatchers(ProjectWatches.NotifyType type, boolean includeWatchersFromNotifyConfig)Returns all watchers that are relevantprotected voidincludeWatchers(ProjectWatches.NotifyType type)Include users and groups that want notification of events.protected voidincludeWatchers(ProjectWatches.NotifyType type, boolean includeWatchersFromNotifyConfig)Include users and groups that want notification of events.protected voidinit()Setup the message headers and envelope (TO, CC, BCC).protected voidsetupSoyContext()-
Methods inherited from class com.google.gerrit.server.mail.send.OutgoingEmail
add, add, add, add, add, add, add, add, addByEmail, addByEmail, appendHtml, appendText, format, getFromLine, getGerritHost, getNameEmailFor, getNameFor, getSettingsUrl, getUserNameEmailFor, isVisibleTo, removeHeader, removeUser, send, setFrom, setHeader, setHeader, setNotify, shouldSendMessage, soyHtmlTemplate, supportsHtml, textTemplate, useHtml
-
-
-
-
Field Detail
-
branch
protected BranchNameKey branch
-
-
Constructor Detail
-
NotificationEmail
protected NotificationEmail(EmailArguments args, String messageClass, BranchNameKey branch)
-
-
Method Detail
-
init
protected void init() throws com.google.gerrit.exceptions.EmailExceptionDescription copied from class:OutgoingEmailSetup the message headers and envelope (TO, CC, BCC).- Overrides:
initin classOutgoingEmail- Throws:
com.google.gerrit.exceptions.EmailException- if an error occurred.
-
includeWatchers
protected void includeWatchers(ProjectWatches.NotifyType type)
Include users and groups that want notification of events.
-
includeWatchers
protected void includeWatchers(ProjectWatches.NotifyType type, boolean includeWatchersFromNotifyConfig)
Include users and groups that want notification of events.
-
getWatchers
protected abstract ProjectWatch.Watchers getWatchers(ProjectWatches.NotifyType type, boolean includeWatchersFromNotifyConfig)
Returns all watchers that are relevant
-
add
protected void add(RecipientType type, com.google.gerrit.server.mail.send.ProjectWatch.Watchers.List list)
Add users or email addresses to the TO, CC, or BCC list.
-
getSshHost
public String getSshHost()
-
setupSoyContext
protected void setupSoyContext()
- Overrides:
setupSoyContextin classOutgoingEmail
-
-