def _send_new_pending_email(instance):
 context = {'approval_url': urlunsplit((('https' if (settings.HTTPS == 'on') else 'http'), instance.site.domain, reverse('admin:api_admin_apiaccessrequest_change', args=(instance.id,)), '', '')), 'api_request': instance}
 message = render_to_string('api_admin/api_access_request_email_new_request.txt', context)
 try:
  send_mail(_('API access request from {company}').format(company=instance.company_name), message, settings.API_ACCESS_FROM_EMAIL, [settings.API_ACCESS_MANAGER_EMAIL], fail_silently=False)
 except SMTPException:
  log.exception('Error sending API user notification email for request [%s].', instance.id)

def _send_new_pending_email ( instance ) : context = { 'approval_url' : urlunsplit ( ( ( 'https' if ( settings . HTTPS == 'on' ) else 'http' ) , instance . site . domain , reverse ( 'admin:api_admin_apiaccessrequest_change' , args = ( instance . id , ) ) , '' , '' ) ) , 'api_request' : instance } message = render_to_string ( 'api_admin/api_access_request_email_new_request.txt' , context ) try : send_mail ( _ ( 'API access request from {company}' ) . format ( company = instance . company_name ) , message , settings . API_ACCESS_FROM_EMAIL , [ settings . API_ACCESS_MANAGER_EMAIL ] , fail_silently = False ) except SMTPException : log . exception ( 'Error sending API user notification email for request [%s].' , instance . id )
send an email to settings .