Skip to content

Add ADDRESS using update_list_member merge fields #313

Description

@peterrwilson99

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions