Skip to content
Permalink
Browse files

JENKINS-37163 emailext Pipeline step sends mails to irrelevant people

  • Loading branch information
davidvanlaatum committed Aug 4, 2016
1 parent 0e27b84 commit d505d3d2f38601bcfe029845b8a20576fd58045f
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/main/java/hudson/plugins/emailext/EmailExtStep.java
@@ -12,6 +12,7 @@
import hudson.plugins.emailext.plugins.EmailTrigger;
import hudson.plugins.emailext.plugins.RecipientProvider;
import hudson.plugins.emailext.plugins.RecipientProviderDescriptor;
import hudson.plugins.emailext.plugins.recipients.ListRecipientProvider;
import hudson.plugins.emailext.plugins.trigger.AlwaysTrigger;
import jenkins.model.Jenkins;
import org.apache.commons.lang.StringUtils;
@@ -151,6 +152,8 @@ protected Void run() throws Exception {

AlwaysTrigger.DescriptorImpl descriptor = Jenkins.getActiveInstance().getDescriptorByType(AlwaysTrigger.DescriptorImpl.class);
EmailTrigger trigger = descriptor.createDefault();
trigger.getEmail().getRecipientProviders().clear();
trigger.getEmail().addRecipientProvider(new ListRecipientProvider());
if (step.recipientProviders != null) {
RecipientProvider.checkAllSupport(step.recipientProviders, run.getParent().getClass());
trigger.getEmail().addRecipientProviders(step.recipientProviders);

0 comments on commit d505d3d

Please sign in to comment.
You can’t perform that action at this time.