@check_login_required
@check_local_site_access
def preview_review_email(request, review_request_id, review_id, format, text_template_name=u'notifications/review_email.txt', html_template_name=u'notifications/review_email.html', extra_context={}, local_site=None):
 if (not settings.DEBUG):
  raise Http404
 (review_request, response) = _find_review_request(request, review_request_id, local_site)
 if (not review_request):
  return response
 review = get_object_or_404(Review, pk=review_id, review_request=review_request)
 siteconfig = SiteConfiguration.objects.get_current()
 review.ordered_comments = review.comments.order_by(u'filediff', u'first_line')
 if (format == u'text'):
  template_name = text_template_name
  mimetype = u'text/plain'
 elif (format == u'html'):
  template_name = html_template_name
  mimetype = u'text/html'
 else:
  raise Http404
 context = {u'review_request': review_request, u'review': review, u'user': request.user, u'domain': Site.objects.get_current().domain, u'domain_method': siteconfig.get(u'site_domain_method')}
 context.update(extra_context)
 (has_error, context[u'comment_entries']) = build_diff_comment_fragments(review.ordered_comments, context, u'notifications/email_diff_comment_fragment.html')
 return HttpResponse(render_to_string(template_name, RequestContext(request, context)), content_type=mimetype)

@ check_login_required @ check_local_site_access def preview_review_email ( request , review_request_id , review_id , format , text_template_name = u'notifications/review_email.txt' , html_template_name = u'notifications/review_email.html' , extra_context = { } , local_site = None ) : if ( not settings . DEBUG ) : raise Http404 ( review_request , response ) = _find_review_request ( request , review_request_id , local_site ) if ( not review_request ) : return response review = get_object_or_404 ( Review , pk = review_id , review_request = review_request ) siteconfig = SiteConfiguration . objects . get_current ( ) review . ordered_comments = review . comments . order_by ( u'filediff' , u'first_line' ) if ( format == u'text' ) : template_name = text_template_name mimetype = u'text/plain' elif ( format == u'html' ) : template_name = html_template_name mimetype = u'text/html' else : raise Http404 context = { u'review_request' : review_request , u'review' : review , u'user' : request . user , u'domain' : Site . objects . get_current ( ) . domain , u'domain_method' : siteconfig . get ( u'site_domain_method' ) } context . update ( extra_context ) ( has_error , context [ u'comment_entries' ] ) = build_diff_comment_fragments ( review . ordered_comments , context , u'notifications/email_diff_comment_fragment.html' ) return HttpResponse ( render_to_string ( template_name , RequestContext ( request , context ) ) , content_type = mimetype )
previews the e-mail message that would be sent for a review of a review request .