Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ADDRESS using update_list_member merge fields #313

Open
peterrwilson99 opened this issue Sep 18, 2021 · 0 comments
Open

Add ADDRESS using update_list_member merge fields #313

peterrwilson99 opened this issue Sep 18, 2021 · 0 comments

Comments

@peterrwilson99
Copy link

peterrwilson99 commented Sep 18, 2021

I am updating customers using the Python API. I get a successful response, however the response is still an empty string in the address field.

Python code:

    # mailchimp office address
    address_dict = {
        "addr1": "2015 Main St",
        "addr2": "",
        "city": "Vancouver",
        "state": "BC",
        "country": "Canada",
        "zip": "V5T 3C2",
        }
    merge_fields = {
        'MMERGE7': other_info,
        'MMERGE9': other_info,
        'MMERGE10': other_info,
        'ADDRESS': address_dict,
    }
    try:
        response = client.lists.update_list_member("AUDIENCE_ID", "SUBSCRIBER_HASH", merge_fields)
        print("Succesful Update on", customer['Email'])
        print(response['merge_fields'])

Output of merge fields response

{'FNAME': '', 
'LNAME': '', 
'ADDRESS': '', 
'PHONE': '', 
'MMERGE5': '', 
'MMERGE6': '', 
'MMERGE7': '', 
'MMERGE9': 'CUSTOMER_ID', 
'MMERGE10': 'CUSTOMER NAME', 
'MMERGE11': '', 
'MMERGE12': ''}

Am I doing something wrong here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant