@permission_required('<STR_LIT>')<EOL><INDENT>def post(self, request):<DEDENT>
try:<EOL><INDENT>email, enterprise_name, number_of_codes = self.get_required_query_params(request)<EOL><DEDENT>except CodesAPIRequestError as invalid_request:<EOL><INDENT>return Response({'<STR_LIT:error>': str(invalid_request)}, status=HTTP_400_BAD_REQUEST)<EOL><DEDENT>subject_line = _('<STR_LIT>').format(<EOL>token_enterprise_name=enterprise_name<EOL>)<EOL>msg_with_codes = _('<STR_LIT>'<EOL>'<STR_LIT>').format(<EOL>token_email=email,<EOL>token_enterprise_name=enterprise_name,<EOL>token_number_codes=number_of_codes)<EOL>msg_without_codes = _('<STR_LIT>'<EOL>'<STR_LIT>').format(<EOL>token_email=email,<EOL>token_enterprise_name=enterprise_name)<EOL>app_config = apps.get_app_config("<STR_LIT>")<EOL>from_email_address = app_config.customer_success_email<EOL>cs_email = app_config.customer_success_email<EOL>data = {<EOL>self.REQUIRED_PARAM_EMAIL: email,<EOL>self.REQUIRED_PARAM_ENTERPRISE_NAME: enterprise_name,<EOL>self.OPTIONAL_PARAM_NUMBER_OF_CODES: number_of_codes,<EOL>}<EOL>try:<EOL><INDENT>mail.send_mail(<EOL>subject_line,<EOL>msg_with_codes if number_of_codes else msg_without_codes,<EOL>from_email_address,<EOL>[cs_email],<EOL>fail_silently=False<EOL>)<EOL>return Response(data, status=HTTP_200_OK)<EOL><DEDENT>except SMTPException:<EOL><INDENT>error_message = _(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>).format(<EOL>token_cs_email=cs_email,<EOL>token_email=email,<EOL>token_enterprise_name=enterprise_name<EOL>)<EOL>LOGGER.error(error_message)<EOL>return Response(<EOL>{'<STR_LIT:error>': str('<STR_LIT>')},<EOL>status=HTTP_500_INTERNAL_SERVER_ERROR<EOL>)<EOL><DEDENT>
POST /enterprise/api/v1/request_codes

Requires a JSON object of the following format:
>>> {
>>>     "email": "bob@alice.com",
>>>     "enterprise_name": "IBM",
>>>     "number_of_codes": "50"
>>> }

Keys:
*email*
    Email of the customer who has requested more codes.
*enterprise_name*
    The name of the enterprise requesting more codes.
*number_of_codes*
    The number of codes requested.