Package hudson.tasks
Class Mailer
java.lang.Object
hudson.tasks.BuildStepCompatibilityLayer
hudson.tasks.Publisher
hudson.tasks.Notifier
hudson.tasks.Mailer
- All Implemented Interfaces:
ExtensionPoint
,Describable<Publisher>
,BuildStep
,SimpleBuildStep
Publisher
that sends the build result in e-mail.- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static class
Per user property that is e-mail address.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
Nested classes/interfaces inherited from interface jenkins.tasks.SimpleBuildStep
SimpleBuildStep.LastBuildAction, SimpleBuildStep.LastBuildActionFactory
-
Field Summary
Modifier and TypeFieldDescriptionstatic boolean
Deprecated.This hack may be removed in future versionsstatic Mailer.DescriptorImpl
Deprecated.as of 1.286 Usedescriptor()
to obtain the current instance.boolean
If true, only the first unstable build will be reported.protected static final Logger
Whitespace-separated list of e-mail addresses that represent recipients.boolean
If true, individuals will receive e-mails regarding who broke the build.Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Mailer.DescriptorImpl
This class does explicit check pointing.boolean
boolean
perform
(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) void
perform
(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) static jakarta.mail.internet.InternetAddress
stringToAddress
(String strAddress, String charset) Converts a string toInternetAddress
.static jakarta.mail.internet.InternetAddress
StringToAddress
(String strAddress, String charset) Deprecated.Methods inherited from class hudson.tasks.Notifier
getDescriptor
Methods inherited from class hudson.tasks.Publisher
all, getProjectAction, needsToRunAfterFinalized, prebuild
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, getProjectActions, perform, prebuild
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface hudson.tasks.BuildStep
getProjectAction, getProjectActions, prebuild
Methods inherited from interface jenkins.tasks.SimpleBuildStep
perform, perform, requiresWorkspace
-
Field Details
-
LOGGER
-
recipients
Whitespace-separated list of e-mail addresses that represent recipients. -
dontNotifyEveryUnstableBuild
public boolean dontNotifyEveryUnstableBuildIf true, only the first unstable build will be reported. -
sendToIndividuals
public boolean sendToIndividualsIf true, individuals will receive e-mails regarding who broke the build. -
DESCRIPTOR
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("1.355") public static Mailer.DescriptorImpl DESCRIPTORDeprecated.as of 1.286 Usedescriptor()
to obtain the current instance. -
debug
Deprecated.This hack may be removed in future versionsDebug probe point to be activated by the scripting console.
-
-
Constructor Details
-
Mailer
Deprecated.Default Constructor. This is left for backward compatibility. -
Mailer
@DataBoundConstructor public Mailer(String recipients, boolean notifyEveryUnstableBuild, boolean sendToIndividuals) - Parameters:
recipients
- one or more recipients with separatorsnotifyEveryUnstableBuild
- inverted for historical reasons.sendToIndividuals
- iftrue
mails are sent to individual committers
-
-
Method Details
-
isNotifyEveryUnstableBuild
public boolean isNotifyEveryUnstableBuild() -
perform
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException- Specified by:
perform
in interfaceBuildStep
- Overrides:
perform
in classBuildStepCompatibilityLayer
- Throws:
InterruptedException
IOException
-
perform
public void perform(Run<?, ?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException- Specified by:
perform
in interfaceSimpleBuildStep
- Throws:
IOException
InterruptedException
-
getRequiredMonitorService
This class does explicit check pointing.- Specified by:
getRequiredMonitorService
in interfaceBuildStep
-
StringToAddress
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("1.16") public static jakarta.mail.internet.InternetAddress StringToAddress(String strAddress, String charset) throws jakarta.mail.internet.AddressException, UnsupportedEncodingException Deprecated.Deprecated! Converts a string toInternetAddress
.- Parameters:
strAddress
- Address stringcharset
- Charset (encoding) to be used- Returns:
InternetAddress
for the specified string- Throws:
jakarta.mail.internet.AddressException
- Malformed addressUnsupportedEncodingException
- Unsupported encoding
-
stringToAddress
@NonNull public static jakarta.mail.internet.InternetAddress stringToAddress(@NonNull String strAddress, @NonNull String charset) throws jakarta.mail.internet.AddressException, UnsupportedEncodingException Converts a string toInternetAddress
.- Parameters:
strAddress
- Address stringcharset
- Charset (encoding) to be used- Returns:
InternetAddress
for the specified string- Throws:
jakarta.mail.internet.AddressException
- Malformed addressUnsupportedEncodingException
- Unsupported encoding- Since:
- TODO
-
descriptor
-