Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.conf import settings
- from mailsnake import MailSnake
- ms = MailSnake(settings.MAILCHIMP_API_KEY)
- from django.contrib.auth.models import Group
- group_name = 'group-name'
- list_id = 'list-id'
- group = Group.objects.get(name=group_name)
- for user in group.user_set.all():
- result = ms.listSubscribe(id=list_id, email_address=user.email, update_existing=True, double_optin=False)
- print user, result
Add Comment
Please, Sign In to add comment