SHARE
TWEET

Untitled

a guest Jun 19th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from plugins.newsletter.forms import NewsletterForm
  2. from plugins.newsletter.campaign_monitor_api import CampaignMonitorApi
  3.  
  4. def submit(request):
  5.     api_key = "59ccb89e6658a1684fa03dd061290d41"
  6.     client_id = "483565b6a955fe6ec0b76d6b5b77ab52"
  7.     cm = CampaignMonitorApi(api_key, None)
  8.     listid = '330ee7dfb921dfa40d30aaf93103971c'
  9.     if request.method == 'POST':
  10.         form = NewsletterForm(request.POST)
  11.         if form.is_valid():
  12.             email = form.cleaned_data['email']
  13.             name = form.cleaned_data['name']
  14.             province = form.cleaned_data['province']
  15.             return cm.subscriber_add(listid, email, name)
RAW Paste Data
Want to get better at Python?
Learn to code Python in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top