Hello
we use this script in the presend part of EmailExt plugin. It will change 
the sender email address, if an environment variable is set.
I think you can easily adapt it to your needs

import javax.mail.Message.RecipientType
> import javax.mail.Address
> import javax.mail.internet.InternetAddress
> import javax.mail.internet.MimeMessage
> if ("${ENV,var="PROJECT_ADMIN_MAIL"}") {
>     msg.setFrom(new InternetAddress("${ENV,var="PROJECT_ADMIN_MAIL"}"))
> }



Le lundi 31 mars 2014 08:16:41 UTC+2, Max Rydahl Andersen a écrit :
>
> 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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/9b2585b5-69e8-4f76-b30f-bd2513cc0a53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to