In reading the docs 
<http://developer-blog.cloudbees.com/2015/01/mail-step-for-jenkins-workflow.html>,
 
some Jira issues <https://issues.jenkins-ci.org/browse/JENKINS-26104>and the 
source code 
<https://github.com/jenkinsci/workflow-plugin/blob/master/basic-steps/src/main/java/org/jenkinsci/plugins/workflow/steps/MailStep.java>,
 
as I understand it, there are two options for sending mail in workflows, 
you can invoke the standard mailer via the step $class: 
'hudson.tasks.Mailer' notation, or you can use the mail step.  The standard 
mailer is insufficient for our purposes as it does not give enough control 
over the messages. The extended mailer would be sufficient but is not 
available via step.  The mail step itself gives enough control but lacks 
the logic of the mailer plug-in, which is why I am trying to figure out how 
to the logic myself.  

On Wednesday, February 4, 2015 at 3:01:17 PM UTC-5, slide wrote:
>
> Doesn't workflow support using Mailer directly? I thought there was a way 
> to use Mailer in the workflow.
>
> On Wed Feb 04 2015 at 12:59:05 PM Kenneth Baltrinic <ken...@baltrinic.com 
> <javascript:>> wrote:
>
>> I feel like I have read how to do this somewhere already but now that I 
>> need it I can't find it.  I am trying to duplication the behavior of the 
>> mailer within a workflow script.  Namely if the build failed send an 
>> e-mail.  If it succeed but the previous build failed, send a different 
>> email.  In order to do this, I need to access the build object (something 
>> that implements AbstractBuild and Run) for the current, in-flight build, so 
>> that I can get the current result and the previous build result.  Can 
>> someone advise as to how to do this?  Or is there a functionally built into 
>> the mail step that I can leverage somehow to send different 
>> messages/subjects based on current and previous build status?  
>>
>> It seems like this is going to be a common need in workflow so perhaps 
>> adding an example somewhere in the docs of how to do this might be in order?
>>
>> -- 
>> 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-use...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/b0fb68ae-61ff-4103-8af6-efe808af1518%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/b0fb68ae-61ff-4103-8af6-efe808af1518%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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/62bc5b5e-fb36-4c96-87c4-8a955e10bb31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to