Jenkins: Email notification when build starts

In Jenkins, there is a way to send mail when the build starts. I know that there is an email notification after the build that sends mail to the specified recipients after a successful or unsuccessful build. Similarly, I expect something like advance notice.

There is also a conditional email, for example, if the username == null is sent to the address xyz@domain.com , otherwise send it to the requestor.

Tried: a couple of plugins, but did not help, since they were plugins after the build

+7
jenkins
source share
3 answers

Please note that the post-build action will solve your problem, even if you plan to send an email before the build.

  1. After that, go to the job settings and " Add creation message "> " Editable email notification "

  2. Click Avanced Settings : Click advanced settings ...

  3. Now, in Triggers , just add a new trigger and select " Before Build ". enter image description here

For the second part, the solution is to put the list of recipients in an environment variable (for example, a string parameter called EMAIL_RECIPIENT ) and then use it in the recipient list of editable email notifications as $ {EMAIL_RECIPIENT} .

+13
source share

If you have sendmail configured, just use the Run Shell section and write code to send emails before the build starts.

0
source share

You can try Extend Email-ext, it has Before assembly in the Triggers section.

https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin

0
source share

All Articles