def _email(self, request, username, user_email, message): """ Sends an email Bto support based on feedback from a client machine Returns a response. """ return feedback_email(request, username, user_email, message)
def post(self, request): """ Creates a new feedback email and sends it to admins """ data = request.data required = ['message',] missing_keys = valid_post_data(data, required) if missing_keys: return keys_not_found(missing_keys) #Pass arguments user = request.user message = data['message'] user_email = lookupEmail(user.username) result = feedback_email(request, user.username, user_email, message) return Response(result, status=status.HTTP_201_CREATED)
def post(self, request): """ Creates a new feedback email and sends it to admins """ data = request.DATA required = ['message',] missing_keys = valid_post_data(data, required) if missing_keys: return keys_not_found(missing_keys) #Pass arguments user = request.user message = data['message'] user_email = lookupEmail(user.username) result = feedback_email(request, user.username, user_email, message) return Response(result, status=status.HTTP_201_CREATED)