@cronjobs.register
def survey_recent_askers():
 if settings.STAGE:
  return
 two_days_ago = (date.today() - timedelta(days=2))
 yesterday = (date.today() - timedelta(days=1))
 emails = Question.objects.filter(created__gte=two_days_ago, created__lt=yesterday).values_list('creator__email', flat=True)
 for email in emails:
  add_email_to_campaign('askers', email)
 statsd.gauge('survey.askers', len(emails))

@ cronjobs . register def survey_recent_askers ( ) : if settings . STAGE : return two_days_ago = ( date . today ( ) - timedelta ( days = 2 ) ) yesterday = ( date . today ( ) - timedelta ( days = 1 ) ) emails = Question . objects . filter ( created__gte = two_days_ago , created__lt = yesterday ) . values_list ( 'creator__email' , flat = True ) for email in emails : add_email_to_campaign ( 'askers' , email ) statsd . gauge ( 'survey.askers' , len ( emails ) )
add question askers to a surveygizmo campaign to get surveyed .