code: def render_or_send(func, message):
      
      if request.endpoint != func.func_name:
          mail.send(message)
  
      if (current_user.is_authenticated() and current_user.superuser):
          return render_template('debug_email.html', message=message)
docs: Renders an email message for debugging or actually sends it.