def email(registry, xml_parent, data):
 mailer = XML.SubElement(xml_parent, 'hudson.tasks.Mailer')
 mailer.set('plugin', 'mailer')
 mapping = [('recipients', 'recipients', None)]
 helpers.convert_mapping_to_xml(mailer, data, mapping, fail_required=True)
 if data.get('notify-every-unstable-build', True):
  XML.SubElement(mailer, 'dontNotifyEveryUnstableBuild').text = 'false'
 else:
  XML.SubElement(mailer, 'dontNotifyEveryUnstableBuild').text = 'true'
 XML.SubElement(mailer, 'sendToIndividuals').text = str(data.get('send-to-individuals', False)).lower()

def email ( registry , xml_parent , data ) : mailer = XML . SubElement ( xml_parent , 'hudson.tasks.Mailer' ) mailer . set ( 'plugin' , 'mailer' ) mapping = [ ( 'recipients' , 'recipients' , None ) ] helpers . convert_mapping_to_xml ( mailer , data , mapping , fail_required = True ) if data . get ( 'notify-every-unstable-build' , True ) : XML . SubElement ( mailer , 'dontNotifyEveryUnstableBuild' ) . text = 'false' else : XML . SubElement ( mailer , 'dontNotifyEveryUnstableBuild' ) . text = 'true' XML . SubElement ( mailer , 'sendToIndividuals' ) . text = str ( data . get ( 'send-to-individuals' , False ) ) . lower ( )
sends an email to to_email with a message containing msg .