Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins email-ext plugin thinks I have no recipients configured

Tags:

email

jenkins

I'm using Jenkins 2.2 and email-ext plugin 2.42 (both current, as are all of the rest of my plugins). I have my global configuration set to have a single, explicit recipient and my project is using default email notification configuration (that is, send to $DEFAULT_RECIPIENTS). I have also set an explicit recipient in the project. In both configurations, the console output for the job says:

An attempt to send an e-mail to empty list of recipients, ignored.

This would seem to be https://issues.jenkins-ci.org/browse/JENKINS-13583 except 1. that was marked as resolved four years ago, and 2. I get e-mail when I use basic, built-in notifications. Does anyone else see this problem with email-ext?

like image 889
Chris Nelson Avatar asked May 10 '16 16:05

Chris Nelson


People also ask

How do I add a recipient list in Jenkins?

For a project to use this plugin, you need to enable it in the project configuration page. In the Post-build Actions section, click on Add post-build action and then select Editable Email Notification. There are three main fields that you can edit when this plugin is enabled: Project Recipient List.

In which section of the Jenkins job configuration would you configure email notifications?

Practical Guide to Jenkins Jenkins comes with an out of box facility to add an email notification for a build project. Step 1 − Configuring an SMTP server. Goto Manage Jenkins → Configure System. Go to the E-mail notification section and enter the required SMTP server and user email-suffix details.

How do I turn on email notifications in Jenkins?

Open Jenkins using the following URL: http://localhost:8080/ on any browser (in this tutorial port 8071 is used). Click on Manage Jenkins. Click on Manage Plugins. Select Email Extension and Email Extension Template Plugin and click Install Without Restart.


2 Answers

Turns out plugin configuration is somewhat non-intuitive; a necessary setting is buried behind an Advanced button. I got answers in https://issues.jenkins-ci.org/browse/JENKINS-34731 and it is working now as follows:

In the Advanced settings, Triggers -> Failure - Any lists "Developers" by default, but not "Recipient List."

like image 156
Chris Nelson Avatar answered Sep 19 '22 18:09

Chris Nelson


For those using this plugin in combination with Job DSL. I have do add the sendTo { recipientList() } block explicitly to the different triggers.

So my DSL looked like this:

extendedEmail {     recipientList('${EMAIL_RECIPIENTS}')     triggers {         failure {             subject('The subject')             content("The content")             sendTo {                 recipientList()             }         }     } } 
like image 38
Pieter Meiresone Avatar answered Sep 21 '22 18:09

Pieter Meiresone