Skip to content

Commit

Permalink
Fix for additional field in mailchimp
Browse files Browse the repository at this point in the history
  • Loading branch information
gzukowski committed Jun 21, 2023
1 parent 5be4f2d commit a61707a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/ChimpInsert/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ async def insert_info(info):
try:
response = mailchimp.lists.get_list_members_info(run.audience_id, offset=get_offset(run.audience_id))
user_id = get_info(response, email)
response = mailchimp.lists.update_list_member(run.audience_id, user_id, {"status" : "subscribed"})
print(f"{email} Stripe user successfully synchronized")
if "stripe" in lname:
response = mailchimp.lists.update_list_member_tags(run.audience_id, user_id, {"tags" : [{"name": "Stripe", "status": "active"}]})
print(f"{email} Stripe user successfully synchronized")
except ApiClientError as err:
print("Error")
print("Error")
except:
print("No data received.")


async def run(context, input):
try:
run.audience_id = context.config['audience_id']
Expand Down

0 comments on commit a61707a

Please sign in to comment.