There is a 'msg' object that is an instance of MimeMessage [1]. The 'build' object is an AbstractBuild [2] instance. To modify the recipients, you would want to do stuff with the 'msg' object.
1 - http://geronimo.apache.org/maven/specs/geronimo-javamail_1.4_spec/1.6/apidocs/javax/mail/internet/MimeMessage.html 2 - http://javadoc.jenkins-ci.org/hudson/model/AbstractBuild.html On Wed, Feb 24, 2016 at 5:14 AM <[email protected]> wrote: > Hi > I'm trying to add pre-send script and modify the recipients list using > groovy just like you mentioned , but I can't find relevant wiki for this. > Where I can see the API I can use inside the script. > only saw examples using 'build' and using 'User' APIs. is there any > build.Recipients = /***/ ? > > thanks in advance > > > On Monday, March 31, 2014 at 3:56:11 PM UTC+3, slide wrote: > >> Environment variables work fine, you use the ENV token like ${ENV, >> var="YOURVAR"}. You could also use a presend script to modify the recipient >> list using a groovy script. See the wiki for more info. >> > On Mar 31, 2014 1:24 AM, "Max Rydahl Andersen" <[email protected]> >> wrote: >> > I found this issue: https://issues.jenkins-ci.org/browse/JENKINS-5942 >>> >>> it was closed as incomplete but as far as I can see it is exactly the >>> problem - not possible to access environment variables set by the build in >>> the actual mail. >>> >>> >>> On Monday, March 31, 2014 8:16:41 AM UTC+2, Max Rydahl Andersen wrote: >>>> >>>> Hey, >>>> >>>> Background: >>>> I got a little script (https://github.com/maxandersen/jiralint) which >>>> is used to take queries against Jira locating stale jiras or jiras with >>>> missing/wrong information on them >>>> and then generate a junit test xml report which then in turn makes >>>> jenkins generate a build failure report. Been working great for years but >>>> until now >>>> even I can identifiy the individuals who needs to react for now the >>>> build failure just been blasted out to the whole team. >>>> >>>> I would like to change/fix that. >>>> >>>> Question: >>>> Is it possible by the build itself to change the recipients of the >>>> mail(ext) plugin ? >>>> >>>> a) either by using an environment variable >>>> b) contributing to the list of culprits >>>> >>>> For #A I've only seen it allow build paramters - that is not enough >>>> since I don't know the set of recipients before the build have completed. >>>> For #B I've only found a way to change that is to implement a fork of >>>> the git plugin but I would prefer I could simply add/change the list of >>>> culprits if possible. >>>> >>>> Any ideas/suggestions to the above that does not require *too* exotic >>>> plugins ? :) >>>> >>>> Thanks, >>>> /max >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Jenkins Users" group. >>> >> To unsubscribe from this group and stop receiving emails from it, send an >>> email to [email protected]. >> >> >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- > You received this message because you are subscribed to the Google Groups > "Jenkins Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jenkinsci-users/e5569eb9-6fb2-4aec-8fc2-f08b7bcd7b2c%40googlegroups.com > <https://groups.google.com/d/msgid/jenkinsci-users/e5569eb9-6fb2-4aec-8fc2-f08b7bcd7b2c%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPiUgVeqPg_J-0n-z4WjUqFd%3Dyj45S%3Dra8ChLyRTTsF3oNUpMg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
