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
public class Mailer extends Notifier implements SimpleBuildStep
Publisher
that sends the build result in e-mail.- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Mailer.DescriptorImpl
static class
Mailer.UserProperty
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
Fields Modifier and Type Field Description static boolean
debug
Deprecated.This hack may be removed in future versionsstatic Mailer.DescriptorImpl
DESCRIPTOR
Deprecated.as of 1.286 Usedescriptor()
to obtain the current instance.boolean
dontNotifyEveryUnstableBuild
If true, only the first unstable build will be reported.protected static Logger
LOGGER
String
recipients
Whitespace-separated list of e-mail addresses that represent recipients.boolean
sendToIndividuals
If true, individuals will receive e-mails regarding who broke the build.-
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static Mailer.DescriptorImpl
descriptor()
BuildStepMonitor
getRequiredMonitorService()
This class does explicit check pointing.boolean
isNotifyEveryUnstableBuild()
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 Detail
-
LOGGER
protected static final Logger LOGGER
-
recipients
public String recipients
Whitespace-separated list of e-mail addresses that represent recipients.
-
dontNotifyEveryUnstableBuild
public boolean dontNotifyEveryUnstableBuild
If true, only the first unstable build will be reported.
-
sendToIndividuals
public boolean sendToIndividuals
If 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 DESCRIPTOR
Deprecated.as of 1.286 Usedescriptor()
to obtain the current instance.
-
debug
@Deprecated public static boolean debug
Deprecated.This hack may be removed in future versionsDebug probe point to be activated by the scripting console.
-
-
Constructor Detail
-
Mailer
@Deprecated public 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 Detail
-
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
public BuildStepMonitor 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
public static Mailer.DescriptorImpl descriptor()
-
-