@check_login_required
@check_local_site_access
def preview_review_request_email(request, review_request_id, format, text_template_name=u'notifications/review_request_email.txt', html_template_name=u'notifications/review_request_email.html', changedesc_id=None, 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
 extra_context = {}
 if changedesc_id:
  changedesc = get_object_or_404(review_request.changedescs, pk=changedesc_id)
  extra_context[u'change_text'] = changedesc.text
  extra_context[u'changes'] = changedesc.fields_changed
 siteconfig = SiteConfiguration.objects.get_current()
 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
 return HttpResponse(render_to_string(template_name, RequestContext(request, dict({u'review_request': review_request, u'user': request.user, u'domain': Site.objects.get_current().domain, u'domain_method': siteconfig.get(u'site_domain_method')}, **extra_context))), content_type=mimetype)

@ check_login_required @ check_local_site_access def preview_review_request_email ( request , review_request_id , format , text_template_name = u'notifications/review_request_email.txt' , html_template_name = u'notifications/review_request_email.html' , changedesc_id = None , 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 extra_context = { } if changedesc_id : changedesc = get_object_or_404 ( review_request . changedescs , pk = changedesc_id ) extra_context [ u'change_text' ] = changedesc . text extra_context [ u'changes' ] = changedesc . fields_changed siteconfig = SiteConfiguration . objects . get_current ( ) 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 return HttpResponse ( render_to_string ( template_name , RequestContext ( request , dict ( { u'review_request' : review_request , u'user' : request . user , u'domain' : Site . objects . get_current ( ) . domain , u'domain_method' : siteconfig . get ( u'site_domain_method' ) } , ** extra_context ) ) ) , content_type = mimetype )
previews the e-mail message that would be sent for an initial review request or an update .