Merge "The email publisher needs a list of recipients"

This commit is contained in:
Jenkins 2015-02-24 10:26:29 +00:00 committed by Gerrit Code Review
commit 055b6360fa
5 changed files with 31 additions and 6 deletions

View File

@ -1312,18 +1312,16 @@ def email(parser, xml_parent, data):
:arg bool send-to-individuals: Send an email to the individual
who broke the build (default false)
Example::
Example:
publishers:
- email:
recipients: breakage@example.com
.. literalinclude:: /../../tests/publishers/fixtures/email001.yaml
:language: yaml
"""
# TODO: raise exception if this is applied to a maven job
mailer = XML.SubElement(xml_parent,
'hudson.tasks.Mailer')
if 'recipients' in data:
XML.SubElement(mailer, 'recipients').text = data['recipients']
XML.SubElement(mailer, 'recipients').text = data.get('recipients', '')
# Note the logic reversal (included here to match the GUI
if data.get('notify-every-unstable-build', True):

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.tasks.Mailer>
<recipients>foo@example.com bar@example.com</recipients>
<dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
<sendToIndividuals>false</sendToIndividuals>
</hudson.tasks.Mailer>
</publishers>
</project>

View File

@ -0,0 +1,3 @@
publishers:
- email:
recipients: foo@example.com bar@example.com

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<publishers>
<hudson.tasks.Mailer>
<recipients/>
<dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild>
<sendToIndividuals>true</sendToIndividuals>
</hudson.tasks.Mailer>
</publishers>
</project>

View File

@ -0,0 +1,4 @@
publishers:
- email:
send-to-individuals: true