[FIXED HUDSON-6394] Email recipient lists now support build parameters

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@30485 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
abayer committed 2010-04-29 18:38:39 +00:00
1 parent 3987a82ce2
commit 2eedba8679
1 file changed
+6
@@ -33,6 +33,7 @@ import static hudson.Util.fixEmptyAndTrim;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.BuildListener;
import hudson.model.ParametersAction;
import hudson.model.User;
import hudson.model.UserPropertyDescriptor;
import hudson.model.Hudson;
@@ -103,6 +104,11 @@ public class Mailer extends Notifier {
public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener) throws InterruptedException {
if(debug)
listener.getLogger().println("Running mailer");
// substitute build parameters if available
ParametersAction parameters = build.getAction(ParametersAction.class);
if (parameters!=null)
recipients = parameters.substitute(build, recipients);
return new MailSender(recipients,dontNotifyEveryUnstableBuild,sendToIndividuals, descriptor().getCharset()) {
/** Check whether a path (/-separated) will be archived. */
@Override