Reputation: 159
In Jenkins, Is there a way to send a mail when starting a build. I know there is a post-build email notification which sends mail to the given recipients after a successful or failure build. Similarly i am expecting something like pre build notification.
Also is there a conditional email like if username == null send to [email protected] else send it to requestor.
Tried : couple of plugins but didn't help much as they were post-build plugins
Upvotes: 12
Views: 21161
Reputation: 1469
Notice that a post build action will solve your problem even though what you intend is to send an e-mail before the build.
After that, go to the job configuration and "Add Post Build Action" > "Editable Email Notification"
Now, at Triggers, just add a new trigger and choose "Before Build"
For the second part, the solution is to put the recipient list in an environment variable (for example, a string parameter called EMAIL_RECIPIENT) and then use that in the editable email notification recipients list box as ${EMAIL_RECIPIENT}.
Upvotes: 17
Reputation: 2363
You can try the Extend Email-ext, it has the Before build in the Triggers section.
https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin
Upvotes: 0
Reputation: 821
If you have sendmail configured, just use the "Execute shell" section and write the code to send mails before the build starts.
Upvotes: 0