Guest User

Untitled

a guest
Nov 19th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. from django.conf import settings
  2. from mailsnake import MailSnake
  3. ms = MailSnake(settings.MAILCHIMP_API_KEY)
  4. from django.contrib.auth.models import Group
  5.  
  6. group_name = 'group-name'
  7. list_id = 'list-id'
  8.  
  9. group = Group.objects.get(name=group_name)
  10. for user in group.user_set.all():
  11. result = ms.listSubscribe(id=list_id, email_address=user.email, update_existing=True, double_optin=False)
  12. print user, result
Add Comment
Please, Sign In to add comment