Skip to content

Commit

Permalink
Update API url for CSAT campaign
Browse files Browse the repository at this point in the history
  • Loading branch information
rehandalal committed Mar 2, 2016
1 parent b8188a5 commit 59f8d0b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions kitsune/kpi/cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,18 +684,17 @@ def csat_survey_emails():
for u in users:
p = u.profile
if p.csat_email_sent is None or p.csat_email_sent < start:
user = settings.SURVEYGIZMO_USER
password = settings.SURVEYGIZMO_PASSWORD

survey_id = SURVEYS['general']['community_health']
campaign_id = SURVEYS['general']['community_health_campaign_id']

try:
requests.put(
'https://restapi.surveygizmo.com/v2/survey/{survey}/surveycampaign/'
'{campaign}/contact?semailaddress={email}&user:pass={user}:{password}'.format(
survey=survey_id, campaign=campaign_id,
email=u.email, user=user, password=password),
'https://restapi.surveygizmo.com/v4/survey/{survey}/surveycampaign/'
'{campaign}/contact?semailaddress={email}&api_token={token}'
'&api_token_secret={secret}&allowdupe=true'.format(
survey=survey_id, campaign=campaign_id, email=u.email,
token=settings.SURVEYGIZMO_API_TOKEN,
secret=settings.SURVEYGIZMO_API_TOKEN_SECRET),
timeout=30)
except requests.exceptions.Timeout:
print 'Timed out adding: %s' % u.email
Expand Down

0 comments on commit 59f8d0b

Please sign in to comment.