def inbound_email(request): message = request.data.get('Message', None) if not message: raise ParseError( detail='Message not present in the POST data.') process_email.apply_async((message,)) return Response(status=status.HTTP_201_CREATED)
def inbound_email(request): validation_response = settings.INBOUND_EMAIL_VALIDATION_KEY if request.data.get('Type', '') == 'Validation': # Its just a verification check that the end-point is working. return Response(data=validation_response, status=status.HTTP_200_OK) message = request.data.get('Message', None) if not message: raise ParseError(detail='Message not present in the POST data.') process_email.apply_async((message, )) return Response(data=validation_response, status=status.HTTP_201_CREATED)
def inbound_email(request): validation_response = settings.INBOUND_EMAIL_VALIDATION_KEY if request.data.get('Type', '') == 'Validation': # Its just a verification check that the end-point is working. return Response(data=validation_response, status=status.HTTP_200_OK) message = request.data.get('Message', None) if not message: raise ParseError( detail='Message not present in the POST data.') process_email.apply_async((message,)) return Response(data=validation_response, status=status.HTTP_201_CREATED)