How do I subscribe someone to a list using the python mailchimp API v2.0? -


i want subscribe user list using mailchimp api 2.0 , official mailchimp python package. can't find direct documentation how.

before start, you'll need api key , list id logging mailchimp.

to api key, visit accounts > extras , generate api key. list id, visit lists > list > settings > list name , defaults.

next, make sure you've installed mailchimp python package:

pip install mailchimp 

finally:

import mailchimp api_key = 'my-api-key' list_id = 'my-list-id'   api = mailchimp.mailchimp(api_key) api.lists.subscribe(list_id, {'email': 'email@example.com'}) 

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -