sfdcQuery = """ SELECT Email, MailingPostalCode, Phone, Authorized_Support_Contact__c FROM Contact WHERE LastModifiedDate > %(startTime)s """ % startTime sfdcResults = sfdc.sfdc_query(sfdcQuery) for contact in sfdcResults['results']: data = { } data['tags'] = [] user_id = 0 # Verify the user has already been created in Zendesk if contact['Email'] != '': email = contact['Email'] z = zd.search_by_email(email) if z['count']: user_id = z['users'][0]['id'] data["email"] = email # Only update Zendesk if the user already exists if user_id: # Process the Postal Code to determine Time Zone if contact['MailingPostalCode'] != '': postalcode = re.search('^[0-9]{5}', contact['MailingPostalCode']) if postalcode is not None: timezone = mysqlDb.get_timezone_by_zip(postalcode.group()) if timezone != '': data["time_zone"] = timezone # Check to see if the user is an Authorized Contact