def send_email_after_import(email, result):
 if ('__error' in result):
  send_email(email, action=EVENT_IMPORT_FAIL, subject=MAILS[EVENT_IMPORT_FAIL]['subject'], html=MAILS[EVENT_IMPORT_FAIL]['message'].format(error_text=result['result']['message']))
 else:
  send_email(email, action=EVENT_IMPORTED, subject=MAILS[EVENT_IMPORTED]['subject'].format(event_name=result['name']), html=MAILS[EVENT_IMPORTED]['message'].format(event_url=(request.url_root.strip('/') + ('/events/%d' % result['id']))))

def send_email_after_import ( email , result ) : if ( '__error' in result ) : send_email ( email , action = EVENT_IMPORT_FAIL , subject = MAILS [ EVENT_IMPORT_FAIL ] [ 'subject' ] , html = MAILS [ EVENT_IMPORT_FAIL ] [ 'message' ] . format ( error_text = result [ 'result' ] [ 'message' ] ) ) else : send_email ( email , action = EVENT_IMPORTED , subject = MAILS [ EVENT_IMPORTED ] [ 'subject' ] . format ( event_name = result [ 'name' ] ) , html = MAILS [ EVENT_IMPORTED ] [ 'message' ] . format ( event_url = ( request . url_root . strip ( '/' ) + ( '/events/%d' % result [ 'id' ] ) ) ) )
send email after event import .