Skip to content

Instantly share code, notes, and snippets.

@toast38coza
Created March 11, 2011 11:11
Show Gist options
  • Save toast38coza/865750 to your computer and use it in GitHub Desktop.
Save toast38coza/865750 to your computer and use it in GitHub Desktop.
Add a user to mailchimp with django_mailchimp
"""
requirements:
pip install django_mailchimp
"""
import mailchimp
def add_to_list(self,request, list_id, email):
mailinglist = mailchimp.utils.get_connection().get_list_by_id(list_id)
return mailinglist.subscribe(email,{'EMAIL':email}) # True / False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment