Interface ChangeEmail
- All Superinterfaces:
OutgoingEmail.EmailDecorator
- All Known Implementing Classes:
ChangeEmailImpl
Populates an email for change related notifications.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Implementations of params interface populate details specific to the notification type. -
Method Summary
Modifier and TypeMethodDescriptionvoid
TO or CC all vested parties (change owner, patch set uploader, author).void
BCC any user who has starred this change.void
Any user who has published comments on this change.void
Users who were added as reviewers to this change.Get change for which the email is being sent.Get ChangeData for the change corresponding to the email.Get the text of the "cover letter" (processed changeMessage).int
Get the number of deleted lines in a change.static com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableMap<String,
String>> getDiffTemplateData
(String sourceDiff) Generate a list of maps representing each line of the unified diff.int
Get the number of added lines in a change.Get PatchSet if provided.Get the project entity the change is in; null if its been deleted.Get Timestamp of the event causing the email.Show patch set as unified difference.void
Include users and groups that want notification of events.void
includeWatchers
(NotifyConfig.NotifyType type, boolean includeWatchersFromNotifyConfig) Include users and groups that want notification of events.Get the patch list corresponding to this patch set.listModifiedFiles
(int patchSetId) Get the patch list corresponding to patch set patchSetId of this change.void
Mark the email as non-first in the thread to ensure correct headers will be setvoid
setChangeMessage
(String cm, Instant t) Specify the summary of what happened to the change.void
setEmailOnlyAttentionSetIfEnabled
(boolean value) Specify if the email should only be sent to attention set.void
setPatchSet
(PatchSet ps) Specify PatchSet with which the notification is associated with.void
setPatchSet
(PatchSet ps, PatchSetInfo psi) Specify PatchSet along with additional data.Methods inherited from interface com.google.gerrit.server.mail.send.OutgoingEmail.EmailDecorator
init, isRecipientAllowed, isRecipientAllowed, populateEmailContent, shouldSendMessage
-
Method Details
-
markAsReply
void markAsReply()Mark the email as non-first in the thread to ensure correct headers will be set -
getChange
Change getChange()Get change for which the email is being sent. -
getChangeData
ChangeData getChangeData()Get ChangeData for the change corresponding to the email. -
getTimestamp
Instant getTimestamp()Get Timestamp of the event causing the email.Provided by
setChangeMessage(String, Instant)
. -
setPatchSet
Specify PatchSet with which the notification is associated with. -
getPatchSet
PatchSet getPatchSet()Get PatchSet if provided. -
setPatchSet
Specify PatchSet along with additional data. -
setChangeMessage
Specify the summary of what happened to the change. -
setEmailOnlyAttentionSetIfEnabled
void setEmailOnlyAttentionSetIfEnabled(boolean value) Specify if the email should only be sent to attention set.Only affects users who have corresponding option enabled in the settings.
-
getCoverLetter
String getCoverLetter()Get the text of the "cover letter" (processed changeMessage). -
listModifiedFiles
Get the patch list corresponding to patch set patchSetId of this change. -
listModifiedFiles
Map<String,FileDiffOutput> listModifiedFiles()Get the patch list corresponding to this patch set. -
getInsertionsCount
int getInsertionsCount()Get the number of added lines in a change. -
getDeletionsCount
int getDeletionsCount()Get the number of deleted lines in a change. -
getProjectState
ProjectState getProjectState()Get the project entity the change is in; null if its been deleted. -
addAuthors
TO or CC all vested parties (change owner, patch set uploader, author). -
bccStarredBy
void bccStarredBy()BCC any user who has starred this change. -
includeWatchers
Include users and groups that want notification of events. -
includeWatchers
Include users and groups that want notification of events. -
ccAllApprovals
void ccAllApprovals()Any user who has published comments on this change. -
ccExistingReviewers
void ccExistingReviewers()Users who were added as reviewers to this change. -
getUnifiedDiff
String getUnifiedDiff()Show patch set as unified difference. -
getDiffTemplateData
static com.google.common.collect.ImmutableList<com.google.common.collect.ImmutableMap<String,String>> getDiffTemplateData(String sourceDiff) Generate a list of maps representing each line of the unified diff. The line maps will have a 'type' key which maps to one of 'common', 'add' or 'remove' and a 'text' key which maps to the line's content.- Parameters:
sourceDiff
- the unified diff that we're converting to the map.- Returns:
- map of 'type' to a line's content.
-