Commits

Scott Nixon committed 92df5fb

Added MailChimp + mailsnake auto registration code.

Comments (0)

Files changed (1)

inbounding/dispatch/views.py

     except Refer.DoesNotExist:
         raise Http404
     return HttpResponse("Success")
+
+def mc_signup(request):
+    '''
+    OAuth enhancement: http://apidocs.mailchimp.com/oauth2/
+    API Docs: http://apidocs.mailchimp.com/api/rtfm/
+
+    Exceptions http://apidocs.mailchimp.com/api/1.3/exceptions.field.php
+    '''
+    ck_list_id = mc_list_id = '0a66cc769c'
+    ck_api_key = mc_api_key ='30060673b5472f3674d20c65782422ca-us2'
+    from mailsnake import MailSnake
+    ms = MailSnake(mc_api_key)
+    if ms.ping():
+        ms.listSubscribe(id=mc_list_id, email_address='scott@happyherbivore.com')
+    else:
+        pass
+        #schedule task to subscribe
+
+    return HttpResponse("Done with Banannas")