Commits

Scott Nixon committed cdd5bc3

Refer URI now using validation. Start to add logic for processing updates.

Comments (0)

Files changed (3)

inbounding/dispatch/templates/mailchimp.html

     url: {
       required: true,
       url: true
+    },
+    referuri0: {
+      required: true,
+      url: true,
+      message: "At least 1 refer domain is required."
     }
   }
 });
       $("#mc-apikey-modal").modal("hide");
    });
 
-  $("#referlistform").validate({
-  rules: {
-     referuri0: {
-      required: true,
-      message: "At least 1 refer domain is required."
-      }
-    }
-  });
-
 });
 </script>
 
       </div>
 -->
       <div id="preview" class="preview">
-	<iframe src="http://127.0.0.1:8100/subscribe/" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:; height:;" allowTransparency="true"></iframe>
+	<iframe src="http://127.0.0.1:8100/subscribe/" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:350px; height:200px;" allowTransparency="true"></iframe>
       </div>
       </div>
 

inbounding/dispatch/urls.py

     url(r'^action/$', 'action_page'),                       
     url(r'^capture/$', 'ref_log'), 
     (r'^accounts/', include('userena.urls')),                  
-    url(r'^subscribe/(?P<id>[-\w]+)/$', 'mc_signup'), 
+    url(r'^subscribe/(?P<list_id>[-\w]+)/$', 'mc_signup'), 
     url(r'^subscribe/$', 'mc_signup'),                
 )
 

inbounding/dispatch/views.py

                                                     'template': '1',
                                                     'tpl_values': data,
                                                     'user': request.user})
+        if not created:
+            # Add fields to be updated
+            Action.objects.update(pk=obj.pk)
         return HttpResponse("Updated")
     else:
+        if id:
+            pass
+            #Will need to parse the json
+            #Action.objects.get(mailchimp=id)
         return render_to_response('mailchimp.html', locals(),context_instance=RequestContext(request))
 
 '''
 
 
 
-def mc_signup(request, id=None):
+def mc_signup(request, list_id=None):
     '''
     OAuth enhancement: http://apidocs.mailchimp.com/oauth2/
     API Docs: http://apidocs.mailchimp.com/api/rtfm/
 
         ms = MailSnake(mc_api_key)
         if ms.ping():
-            ms.listSubscribe(id=mc_list_id, email_address=post['EMAIL'])
+            ms.listSubscribe(id=list_id, email_address=post['EMAIL'])
         else:
             pass
         #schedule task to subscribe