Quantcast

Custom Action: Sending E-Mail

classic Classic list List threaded Threaded
3 messages Options
jwa
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Custom Action: Sending E-Mail

jwa
Good Morning Folks,

I've written a custom action, to integrate with some third-party proprietary mechanisms internally within the company I work for.

This is all working well, however - I'd like to send an e-mail when the action has finished.

Can I obtain a handle to Jenkin's e-mail facilities, so that I can use the configured SMTP, etc?

Thanks,

jwa.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Custom Action: Sending E-Mail

Christopher Orr
On 08/14/2012 11:43 AM, jwa wrote:
> I've written a custom action, to integrate with some
> third-party proprietary mechanisms internally within the company I work for.
>
> This is all working well, however - I'd like to send an e-mail when the
> action has finished.
>
> Can I obtain a handle to Jenkin's e-mail facilities, so that I can use
> the configured SMTP, etc?

I haven't used this myself, but a quick look at the source suggests you
could try hudson.tasks.Mailer.getDescriptor().getSmtpServer() etc.

https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/tasks/Mailer.java

Regards,
Chris

jwa
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Custom Action: Sending E-Mail

jwa
Hi Chris,

Thanks for your help. That did the trick! :-)

jwa

On Tuesday, 14 August 2012 13:09:22 UTC+1, Christopher Orr wrote:
On 08/14/2012 11:43 AM, jwa wrote:
> I've written a custom action, to integrate with some
> third-party proprietary mechanisms internally within the company I work for.
>
> This is all working well, however - I'd like to send an e-mail when the
> action has finished.
>
> Can I obtain a handle to Jenkin's e-mail facilities, so that I can use
> the configured SMTP, etc?

I haven't used this myself, but a quick look at the source suggests you
could try hudson.tasks.Mailer.getDescriptor().getSmtpServer() etc.

https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/tasks/Mailer.java

Regards,
Chris

Loading...