Package hudson.plugins.emailext
Class ExtendedEmailPublisher
- java.lang.Object
-
- hudson.tasks.BuildStepCompatibilityLayer
-
- hudson.tasks.Publisher
-
- hudson.tasks.Notifier
-
- hudson.plugins.emailext.ExtendedEmailPublisher
-
- All Implemented Interfaces:
ExtensionPoint
,hudson.matrix.MatrixAggregatable
,Describable<Publisher>
,BuildStep
public class ExtendedEmailPublisher extends Notifier implements hudson.matrix.MatrixAggregatable
Publisher
that sends notification e-mail.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.tasks.Publisher
Publisher.DescriptorExtensionListImpl
-
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
BuildStep.PublisherList
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description boolean
attachBuildLog
True to attach the log from the build to the email.String
attachmentsPattern
The project wide set of attachments.boolean
compressBuildLog
True to compress the log from the build before attaching to the emailList<EmailTrigger>
configuredTriggers
This is the list of email theTriggers that the project has configuredString
contentType
The contentType of the emails for this project (text/html, text/plain, etc).static String
DEFAULT_BODY_TEXT
static String
DEFAULT_EMERGENCY_REROUTE_TEXT
static String
DEFAULT_SUBJECT_TEXT
String
defaultContent
The default body of the emails for this project.String
defaultSubject
The default subject of the emails for this project.boolean
disabled
If true, disables the publisher from running.String
from
From value for the e-mailMatrixTriggerMode
matrixTriggerMode
How to theTrigger the email if the project is a matrix project.static String
PROJECT_DEFAULT_BODY_TEXT
static String
PROJECT_DEFAULT_SUBJECT_TEXT
String
recipientList
A comma-separated list of email recipient that will be used for every theTrigger.String
replyTo
Reply-To value for the e-mailboolean
saveOutput
If true, save the generated email content to email-ext-message.[txt|html]-
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
-
Constructor Summary
Constructors Constructor Description ExtendedEmailPublisher()
ExtendedEmailPublisher(String project_recipient_list, String project_content_type, String project_default_subject, String project_default_content, String project_attachments, String project_presend_script, int project_attach_buildlog, String project_replyto, String project_from, boolean project_save_output, List<EmailTrigger> project_triggers, MatrixTriggerMode matrixTriggerMode)
Deprecated.ExtendedEmailPublisher(String project_recipient_list, String project_content_type, String project_default_subject, String project_default_content, String project_attachments, String project_presend_script, int project_attach_buildlog, String project_replyto, String project_from, boolean project_save_output, List<EmailTrigger> project_triggers, MatrixTriggerMode matrixTriggerMode, boolean project_disabled, List<GroovyScriptPath> classpath)
-
Method Summary
-
Methods inherited from class hudson.tasks.Publisher
all, getProjectAction, prebuild
-
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, perform
-
-
-
-
Field Detail
-
DEFAULT_SUBJECT_TEXT
public static final String DEFAULT_SUBJECT_TEXT
- See Also:
- Constant Field Values
-
DEFAULT_BODY_TEXT
public static final String DEFAULT_BODY_TEXT
- See Also:
- Constant Field Values
-
DEFAULT_EMERGENCY_REROUTE_TEXT
public static final String DEFAULT_EMERGENCY_REROUTE_TEXT
- See Also:
- Constant Field Values
-
PROJECT_DEFAULT_SUBJECT_TEXT
public static final String PROJECT_DEFAULT_SUBJECT_TEXT
- See Also:
- Constant Field Values
-
PROJECT_DEFAULT_BODY_TEXT
public static final String PROJECT_DEFAULT_BODY_TEXT
- See Also:
- Constant Field Values
-
recipientList
public String recipientList
A comma-separated list of email recipient that will be used for every theTrigger.
-
configuredTriggers
public List<EmailTrigger> configuredTriggers
This is the list of email theTriggers that the project has configured
-
contentType
public String contentType
The contentType of the emails for this project (text/html, text/plain, etc).
-
defaultSubject
public String defaultSubject
The default subject of the emails for this project. ($PROJECT_DEFAULT_SUBJECT)
-
defaultContent
public String defaultContent
The default body of the emails for this project. ($PROJECT_DEFAULT_BODY)
-
attachmentsPattern
public String attachmentsPattern
The project wide set of attachments.
-
attachBuildLog
public boolean attachBuildLog
True to attach the log from the build to the email.
-
compressBuildLog
public boolean compressBuildLog
True to compress the log from the build before attaching to the email
-
replyTo
public String replyTo
Reply-To value for the e-mail
-
from
public String from
From value for the e-mail
-
saveOutput
public boolean saveOutput
If true, save the generated email content to email-ext-message.[txt|html]
-
disabled
public boolean disabled
If true, disables the publisher from running.
-
matrixTriggerMode
public MatrixTriggerMode matrixTriggerMode
How to theTrigger the email if the project is a matrix project.
-
-
Constructor Detail
-
ExtendedEmailPublisher
public ExtendedEmailPublisher()
-
ExtendedEmailPublisher
@Deprecated public ExtendedEmailPublisher(String project_recipient_list, String project_content_type, String project_default_subject, String project_default_content, String project_attachments, String project_presend_script, int project_attach_buildlog, String project_replyto, String project_from, boolean project_save_output, List<EmailTrigger> project_triggers, MatrixTriggerMode matrixTriggerMode)
Deprecated.
-
ExtendedEmailPublisher
@DataBoundConstructor public ExtendedEmailPublisher(String project_recipient_list, String project_content_type, String project_default_subject, String project_default_content, String project_attachments, String project_presend_script, int project_attach_buildlog, String project_replyto, String project_from, boolean project_save_output, List<EmailTrigger> project_triggers, MatrixTriggerMode matrixTriggerMode, boolean project_disabled, List<GroovyScriptPath> classpath)
-
-
Method Detail
-
getClasspath
public List<GroovyScriptPath> getClasspath()
-
setClasspath
public void setClasspath(List<GroovyScriptPath> classpath)
-
setPresendScript
public void setPresendScript(String presendScript)
-
setPostsendScript
@DataBoundSetter public void setPostsendScript(String postsendScript)
-
getPresendScript
public String getPresendScript()
-
getPostsendScript
public String getPostsendScript()
-
getConfiguredTriggers
public List<EmailTrigger> getConfiguredTriggers()
Get the list of configured email theTriggers for this project.- Returns:
- The list of triggers configure for this publisher instance
-
getMatrixTriggerMode
public MatrixTriggerMode getMatrixTriggerMode()
-
setMatrixTriggerMode
public void setMatrixTriggerMode(MatrixTriggerMode matrixTriggerMode)
-
getProjectActions
@NonNull public Collection<? extends Action> getProjectActions(AbstractProject<?,?> project)
- Specified by:
getProjectActions
in interfaceBuildStep
- Overrides:
getProjectActions
in classBuildStepCompatibilityLayer
-
debug
public void debug(PrintStream p, String format, Object... args)
-
prebuild
public boolean prebuild(AbstractBuild<?,?> build, BuildListener listener)
- Specified by:
prebuild
in interfaceBuildStep
- Overrides:
prebuild
in classBuildStepCompatibilityLayer
-
perform
public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener)
- Specified by:
perform
in interfaceBuildStep
- Overrides:
perform
in classBuildStepCompatibilityLayer
-
getRuntimeMacros
public List<org.jenkinsci.plugins.tokenmacro.TokenMacro> getRuntimeMacros(ExtendedEmailPublisherContext context)
-
isExecuteOnMatrixNodes
public boolean isExecuteOnMatrixNodes()
-
needsToRunAfterFinalized
public boolean needsToRunAfterFinalized()
- Overrides:
needsToRunAfterFinalized
in classPublisher
-
getRequiredMonitorService
public BuildStepMonitor getRequiredMonitorService()
- Specified by:
getRequiredMonitorService
in interfaceBuildStep
-
getPreviousRun
@CheckForNull public static Run<?,?> getPreviousRun(@NonNull Run<?,?> run, TaskListener listener)
Looks for a previous build, so long as that is in fact completed. Necessary sincegetRequiredMonitorService()
does not wait for the previous build, so in the case of parallel-capable jobs, we need to behave sensibly when a later build actually finishes before an earlier one.- Parameters:
run
- a run for which we may be sending maillistener
- a listener to which we may print warnings in case the actual previous build is still in progress- Returns:
- the previous build, or null if that build is missing, or is still in progress
-
getDescriptor
public ExtendedEmailPublisherDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<Publisher>
- Overrides:
getDescriptor
in classNotifier
-
descriptor
public static ExtendedEmailPublisherDescriptor descriptor()
-
createAggregator
public hudson.matrix.MatrixAggregator createAggregator(hudson.matrix.MatrixBuild matrixbuild, Launcher launcher, BuildListener buildlistener)
- Specified by:
createAggregator
in interfacehudson.matrix.MatrixAggregatable
-
readResolve
public Object readResolve()
-
-