docs: def getEmailTemplate(request):
      '''
      This function handles the Ajax call made when a user wants a specific email template
      '''
      if request.method != 'POST':
          return HttpResponse(_('Error, no POST data.'))
  
      if not hasattr(request,'user'):
          return HttpResponse(_('Error, not authenticated.'))
  
      template_id = request.POST.get('template')
  
      if not template_id:
          return HttpResponse(_("Error, no template ID provided."))
  
      try:
          this_template = EmailTemplate.objects.get(id=template_id)
      except ObjectDoesNotExist:
          return HttpResponse(_("Error getting template."))
  
      if this_template.groupRequired and this_template.groupRequired not in request.user.groups.all():
          return HttpResponse(_("Error, no permission to access this template."))
      if this_template.hideFromForm:
          return HttpResponse(_("Error, no permission to access this template."))
  
      return JsonResponse({
          'subject': this_template.subject,
          'content': this_template.content,
          'html_content': this_template.html_content,
          'richTextChoice': this_template.richTextChoice,
      })