def email_notification(version, build, email):
 log.debug(LOG_TEMPLATE.format(project=version.project.slug, version=version.slug, msg=('sending email to: %s' % email)))
 context = {'version': version, 'project': version.project, 'build': build, 'build_url': 'https://{0}{1}'.format(getattr(settings, 'PRODUCTION_DOMAIN', 'readthedocs.org'), build.get_absolute_url()), 'unsub_url': 'https://{0}{1}'.format(getattr(settings, 'PRODUCTION_DOMAIN', 'readthedocs.org'), reverse('projects_notifications', args=[version.project.slug]))}
 if build.commit:
  title = _('Failed: {project.name} ({commit})').format(commit=build.commit[:8], **context)
 else:
  title = _('Failed: {project.name} ({version.verbose_name})').format(**context)
 send_email(email, title, template='projects/email/build_failed.txt', template_html='projects/email/build_failed.html', context=context)

def email_notification ( version , build , email ) : log . debug ( LOG_TEMPLATE . format ( project = version . project . slug , version = version . slug , msg = ( 'sending email to: %s' % email ) ) ) context = { 'version' : version , 'project' : version . project , 'build' : build , 'build_url' : 'https://{0}{1}' . format ( getattr ( settings , 'PRODUCTION_DOMAIN' , 'readthedocs.org' ) , build . get_absolute_url ( ) ) , 'unsub_url' : 'https://{0}{1}' . format ( getattr ( settings , 'PRODUCTION_DOMAIN' , 'readthedocs.org' ) , reverse ( 'projects_notifications' , args = [ version . project . slug ] ) ) } if build . commit : title = _ ( 'Failed: {project.name} ({commit})' ) . format ( commit = build . commit [ : 8 ] , ** context ) else : title = _ ( 'Failed: {project.name} ({version.verbose_name})' ) . format ( ** context ) send_email ( email , title , template = 'projects/email/build_failed.txt' , template_html = 'projects/email/build_failed.html' , context = context )
send email notifications for build failure .