parameters: (request, email_id)
return_statement: return render(request, template, args)
docstring: Generate the Email detail page.
  
      :param request: Django request object (Required)
      :type request: :class:`django.http.HttpRequest`
      :param email_id: The ObjectId of the email to get details for.
      :type email_id: str
      :returns: :class:`django.http.HttpResponse`
docstring_summary: Generate the Email detail page.
docstring_tokens: Generate the Email detail page .
function: def email_detail(request, email_id):
      """
      Generate the Email detail page.
  
      :param request: Django request object (Required)
      :type request: :class:`django.http.HttpRequest`
      :param email_id: The ObjectId of the email to get details for.
      :type email_id: str
      :returns: :class:`django.http.HttpResponse`
      """
  
      template = 'email_detail.html'
      user = request.user
      if not user.has_access_to(EmailACL.READ):
          return render(request, 'error.html',
                                    {'error':'User does not have permission to view email.'})
      if request.method == "GET" and request.is_ajax():
          return get_email_formatted(email_id,
                                     user.username,
                                     request.GET.get("format", "json"))
      (new_template, args) = get_email_detail(email_id, user)
      if new_template:
          template = new_template
      return render(request, template, args)
function_tokens: def email_detail ( request , email_id ) : template = 'email_detail.html' user = request . user if not user . has_access_to ( EmailACL . READ ) : return render ( request , 'error.html' , { 'error' : 'User does not have permission to view email.' } ) if request . method == "GET" and request . is_ajax ( ) : return get_email_formatted ( email_id , user . username , request . GET . get ( "format" , "json" ) ) ( new_template , args ) = get_email_detail ( email_id , user ) if new_template : template = new_template return render ( request , template , args )